Este test está cronometrado.
Tienes 1 hora 30 minutos para completar 44 preguntas de este test.
A C variable name can start with a ____
Number
Plus Sign (+)
Underscore
Asterisk (*)
Name the loop that executes at least once.
for
if
do-while
while
A pointer pointing to a memory location of the variable even after deletion of the variable is known as _____
far pointer
dangling pointer
null pointer
void pointer
Which of the following correctly shows the hierarchy of arithmetic operations in C?
/ + * -
* - / +
+ - / *
/ * + -
The output of the following code is: main() { int z, a = 5, b = 3; z = a * 2 + 26 % 3; printf("%d", z); }
10
0
12
None of the above
The output of the following code is: void main() { char a = 'B'; switch (a) { case 'A' : printf("a"); case 'B' : printf("b"); default : printf("c"); } }
B
b
bca
bc
What is the output of this C code? main() { int x=35; printf("%d %d %d",x==35,x=50,x>40); }
1 50 1
0 50 0
Runtime error
Compile time error
Which among the following is NOT a logical or relational operator?
!=
==
||
=
Which of the following is not a correct variable type?
float
real
int
double
Which of the following is true?
1
66
0.1
-1
All of the above
Evaluate !(1 && !(0 || 1)).
True
False
Unevaluatable
Error
Which of the following is the proper declaration of a pointer?
int x;
int &x;
ptr x;
int *x;
Which of the following gives the memory address of integer variable a?
*a;
a;
&a;
address(a);
Which of the following gives the value stored at the address pointed to by pointer a?
val(a);
Which conversion is not possible?
int to float
float to int
char to float
All are possible
What variables stores the number of arguments to a program in command line arguments?
argc
argv
count
arglen
What is argv[0]?
The number of arguments to the program
The name of the program
The first argument to the program
This syntax is illegal
The parameter passing mechanism for an array is
call by value
call by value-result
call by reference
none of these
Consider the statement int val[2] [4] = { 1, 2, 3, 4, 5, 6, 7, 8} ; 4 will be the value of
val[0][ 3]
val[0][4]
val[1][1]
none of the above
The following program fragment int a = 4, b = 6; printf (" %d ", a == b);
outputs an error message
prints 0
prints 1
The following program fragment int a = 4, b = 6; printf ("%d", a = b) ;
6
main( ) { int a = 5, b = 2; printf("%d", a+++b); }
results in syntax error
prints 7
prints 8
none of above
Let x be an integer which can take a value of 0 or 1. The statement if(x = =0) x = 1; else x = 0; is equivalent to which one of the following?
x=1+x;
x=1—x;
x=x—1;
x=1%x;
Which command is used to skip the rest of a loop and carry on from the top of the loop again?
break;
resume;
continue;
skip ;
exit;
Which of the following is not a storage class in C?
auto
struct
extern
static
register
Which of following is not a valid name for a C variable?
Hairaj
Hello_raj
Hello raj
Both (a) and (b) above
None of the above.
How many times the below loop will get executed? main() { int i; for(i=9;i;i=i-2) { printf("\n%d",i); } }
5
Compilation Error
Infinite
What will be the output main() { int i; i = 10; if(i == 20 || 30) {printf("True"); } else {printf("False"); } }
Syntax Error
Run time Error
What the below statement will print if a=10 and b = 20? printf("%d",a==b);
20
What is the output of the following code? void main(){ printf("%d%d%d",50,100); }
50,100
50,100,garbage
50,100,0
0,50,100
What is the output of the following program? void main(){ printf("%d%d",100,200,300); }
100 200
200 300
300 200
100 200 300
What is the output of the following program? void main(){ printf("2+3=%d",2+3); }
2+3=0
2+3=2+3
2+3=5
5=2+3
What is the output of the following program? void main(){ int a; a=3+5*5+3; printf("%d",a); }
43
64
31
what is the output of following program? void main(){ int a; float f; a=12/5; f=12/5; printf("%d%f",a,f); }
2,2.000000
2,2.00
2,2
What is the output of following program? void main(){ int a; a='a'>'A'; printf("%d",a); }
garbage
What is the output of following program? void abc(int a){ ++a; } void main(){ int a=10; abc(); abc(); printf("%d",a); }
11
13
What is the output of following program? void main(){ int i=10; printf("%d%d%d",++i, i++, ++i); }
11 11 13
13 11 11
11 12 13
13 12 11
what is the output of following program? void main(){ printf("One"); if(2>1) printf("Two"); else printf("Three"); printf("Four"); }
One Two Three
Two Three Four
One Two Four
One Three Four
what is the output of following program? void main(){ float a; a=6.7; if(a==6.7) printf("A"); else printf("B"); }
A
error
nothing display on screen
what is the output of following program? void main(){ int a; a=10; a*=10+2; printf("%d",a); }
102
100
120
22
what is the output of following program? void main(){ int a; a=100; printf("%d%d",++a,a++); }
101 101
101 102
102 100
102 101
What is the output of the following program? void main(){ int a; a=100>90>80; printf("%d",a); }
What will be the output of the following program void main( ){ int a=10; printf("%d",a); { int a=20; printf("%d",a); } printf("%d",a); }
10 10
20 10
10 20 10
10 10 10
What is the output of following program? void f1(){ int a=0; ++a; printf("%d",a); } main(){ int a=10; f1(); f1(); f1(); printf("%d",a); return 0; }
0 1 1 10
10 0 1 10
1 2 3 4
1 1 1 10