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.

Discussion

Umam

dan ketertahanan http://goo.gl/TLJKhQ http://bit.ly/2bgLGS7
terhadap pengaruh luar (korosi, aus, bahan kimia, suhu tinggi dan sebagainya).
Besi teknis selalu tercampur dengan unsure-unsur lain misalnya karbon (C), silicon (Si), mangan (Mn), FosfoSee more

1434 days 6 hours 22 minutes ago

priya

very nice test
plz attach explanations also

3410 days 3 hours 14 minutes ago

Youry

Strong mid -level!

3422 days 16 hours 50 minutes ago

Nishant

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

3439 days 4 hours 1 minutes ago

mk

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

3475 days 13 hours 14 minutes ago

shobana

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

3603 days 1 hours 4 minutes ago

Janos Varga

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

3646 days 21 hours 45 minutes ago

aditya vamsi

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

3674 days 7 hours 56 minutes ago

Rupa

Answer to Qs 14 is 6

3764 days 2 hours 13 minutes ago

PazzaC

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 See more

3814 days 18 hours 23 minutes ago

Your Facebook Friends on WizIQ

More Tests By Author

ASP Server Controls
10 Questions | 667 Attempts

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

An ASP.NET Application
10 Questions | 437 Attempts