WizIQ helps you learn and teach online - any subject you can think of!
Join for FREE

C- Programming Language online Test

/
first character of the string constant
complete string
address of the string storage
is a logical error
Consider the following variable declaration Union x{ int i; float f; char c; }y; if the size of i, f and c are 2 bytes, 4 bytes and 1 byte respectively then the size of the variable y is:-
1 byte
2 bytes
4 bytes
7 bytes
Pick up the odd one out from the following
x = x – 1
x - = 1
x - -
x = - 1
What is the value of ‘average’ after the following program is executed? main() { int sum, index ; sum = index = 0 ; float average; sum = 0; for( ; ; ) { sum = sum + index; ++index; if (sum >= 100) break ; } average = sum / index; }
91/13
91/14
105/14
105/15
Suppose i, j, k are integer variables with values 1, 2, 3 respectively. What is the value of the following expression? ! (( j + k ) > ( i + 5 ))
6
5
1
0
If a = -11 and b = -3. What is the value of a % b?
- 3
- 2
2
3
If c is a variable initialized to 1, how many times will the following loop be executed? while(( c > 0 && (c < 60))) { c++; }
61
60
59
1
Which one of the following describes correctly a static variable?
This cannot be initialized.
This is initialized once at the commencement of execution and cannot be changed at run time.
This retains its value through the life of the program.
This is same as an automatic variable but is placed at the head of a program.
What will be the output of the following program? main() { int a, *ptr, b, c; a = 25; ptr = &a; b = a + 30; c = *ptr; printf(“%d %d %d”, a, b, c); }
25, 25, 25
25, 55, 25
25, 25, 55
None of the above
If a = 0(aa and b = a << 1 then which of the following is true
b = a
b = 2a
a = 2b
b = a - 1
In a for loop with a multi statement loop body, semicolons should appear following:
the for statement itself
the crossing brace in the multiple statement loop body
each statement within the loop body and the test expression
each statement within the loop only
When we execute X++; the value of the expression X++ :
is equal to the original value of X
is one more than the original value of X
is X times more than the original value of X
none of the above
An Array’s name is a:
Pointer constant
Pointer variable
Variable name
None of the above
What is printed? for (i=1; i<=5; ) i++; printf(“%d”,i)
23456
12345
123456
error
Main() { int x = 0; while(x<=10) for( ; ; ) if( ++x%10 == 0 ) break; printf(“x = %d”, x) ; } What will be the output of the above program?
Will print x = 10
Will give compilation error
Will give runtime error
Will print x = 20
C uses pointers explicitly with
Arrays
Structures
Functions
All of the above
Description:

A short test on C language
Disclaimer: Content, such as images used in the questions (if any), have been picked up from various places for the sole purpose of Instruction.

Comments
Patel Umang
By: Patel Umang
731 days 17 hours 7 minutes ago

very nice test

PazzaC
By: PazzaC
712 days 13 hours 3 minutes ago

Yet more errors! Question 1: What will 'assign in s' i.e. what is stored in the variable s, is the ADDRESS of the string storage. The variable is a POINTER, so it only ever holds a NUMERICAL VALUE equivalent to a memory address, and NEVER the string contents! Question 12: WRONG! The is in the post-increment position, so the statement is evaluated and THEN incremented. If you evaluate x then we get the ORIGINAL value.

Rupa
By: Rupa
661 days 19 hours 53 minutes ago

Answer to Qs 14 is 6

Rupa
By: aditya vamsi
572 days 2 hours 34 minutes ago

plz see my message also post the supporting reason to ur answer

aditya vamsi
By: aditya vamsi
572 days 2 hours 36 minutes ago

MS rupa i think the answer to the Q.14 is correct .post ur arguments

Janos Varga
By: Janos Varga
544 days 15 hours 25 minutes ago

Q10 answer wrong. aa = 1010 1010 shift left 1 0101 0100

Janos Varga
By: krishandeep
539 days 3 hours 19 minutes ago

q10 is correct as 0xaa is 1byte and int stores 4bytes
so it can store the shifted bit

shobana
By: shobana
500 days 19 hours 44 minutes ago

plz anyone explain 2,4,6,15 plz if anyone know explain me

shobana
By: saobang972
413 days 29 minutes ago

Q2: Because size of Union type is max size of each elements. But Array is amount size of elements
Q4: after you execute for loop you have sum = 105 and index = 15
Q6: -11 div -3 = 3 remain -2 or -11 div -3 = 4 remain 1. you will consider with result is -2 because it take smaller value.
Q15: the author explained above.

this test have some mistake which is attended by some member. I agree with them.
good luck

mk
By: mk
373 days 7 hours 54 minutes ago

most of the answers are wrong..I dont know who designed this test...its misleading and can be worse if you changed your answers because of this stupid test

Nishant
By: Nishant
336 days 22 hours 41 minutes ago

fantastic test ..... i found quite good concept in these questions..........

Youry
By: Youry
320 days 10 hours 29 minutes ago

Strong mid -level!

priya
By: priya
307 days 21 hours 54 minutes ago

very nice test
plz attach explanations also

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no.:


Area code Number
Subject you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy

Your Facebook Friends on WizIQ

More Tests By Author

ASP Server Controls
10 Questions | 227 Attempts

ASP.NET, Namespaces ASP.NET
10 Questions | 855 Attempts

An ASP.NET Application
10 Questions | 173 Attempts

Test your basic knowledge on DATASTRUCTURES, STACK
10 Questions | 410 Attempts