Frage 1
Frage
A C variable name can start with a ____
Antworten
-
Number
-
Plus Sign (+)
-
Underscore
-
Asterisk (*)
Frage 2
Frage
Name the loop that executes at least once.
Frage 3
Frage
A pointer pointing to a memory location of the variable even after deletion of the variable is known as _____
Antworten
-
far pointer
-
dangling pointer
-
null pointer
-
void pointer
Frage 4
Frage
Which of the following correctly shows the hierarchy of arithmetic operations in C?
Antworten
-
/ + * -
-
* - / +
-
+ - / *
-
/ * + -
Frage 5
Frage
The output of the following code is:
main()
{ int z, a = 5, b = 3; z = a * 2 + 26 % 3;
printf("%d", z);
}
Antworten
-
10
-
0
-
12
-
None of the above
Frage 6
Frage
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");
}
}
Frage 7
Frage
What is the output of this C code?
main()
{ int x=35;
printf("%d %d %d",x==35,x=50,x>40);
}
Antworten
-
1 50 1
-
0 50 0
-
Runtime error
-
Compile time error
Frage 8
Frage
Which among the following is NOT a logical or relational operator?
Frage 9
Frage
Which of the following is not a correct variable type?
Frage 10
Frage
Which of the following is true?
Antworten
-
1
-
66
-
0.1
-
-1
-
All of the above
Frage 11
Frage
Evaluate !(1 && !(0 || 1)).
Antworten
-
True
-
False
-
Unevaluatable
-
Error
Frage 12
Frage
Which of the following is the proper declaration of a pointer?
Antworten
-
int x;
-
int &x;
-
ptr x;
-
int *x;
Frage 13
Frage
Which of the following gives the memory address of integer variable a?
Frage 14
Frage
Which of the following gives the value stored at the address pointed to by pointer a?
Frage 15
Frage
Which conversion is not possible?
Antworten
-
int to float
-
float to int
-
char to float
-
All are possible
Frage 16
Frage
What variables stores the number of arguments to a program in command line arguments?
Frage 17
Frage 18
Frage
The parameter passing mechanism for an array is
Antworten
-
call by value
-
call by value-result
-
call by reference
-
none of these
Frage 19
Frage
Consider the statement
int val[2] [4] = { 1, 2, 3, 4, 5, 6, 7, 8} ;
4 will be the value of
Antworten
-
val[0][ 3]
-
val[0][4]
-
val[1][1]
-
none of the above
Frage 20
Frage
The following program fragment
int a = 4, b = 6;
printf (" %d ", a == b);
Antworten
-
outputs an error message
-
prints 0
-
prints 1
-
none of the above
Frage 21
Frage
The following program fragment
int a = 4, b = 6;
printf ("%d", a = b) ;
Antworten
-
outputs an error message
-
prints 0
-
prints 1
-
6
Frage 22
Frage
main( )
{ int a = 5, b = 2;
printf("%d", a+++b);
}
Antworten
-
results in syntax error
-
prints 7
-
prints 8
-
none of above
Frage 23
Frage
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?
Antworten
-
x=1+x;
-
x=1—x;
-
x=x—1;
-
x=1%x;
Frage 24
Frage
Which command is used to skip the rest of a loop and carry on from the top of the loop again?
Antworten
-
break;
-
resume;
-
continue;
-
skip ;
-
exit;
Frage 25
Frage
Which of the following is not a storage class in C?
Antworten
-
auto
-
struct
-
extern
-
static
-
register
Frage 26
Frage
Which of following is not a valid name for a C variable?
Antworten
-
Hairaj
-
Hello_raj
-
Hello raj
-
Both (a) and (b) above
-
None of the above.
Frage 27
Frage
How many times the below loop will get executed?
main()
{ int i;
for(i=9;i;i=i-2)
{ printf("\n%d",i);
}
}
Antworten
-
5
-
6
-
Compilation Error
-
Infinite
Frage 28
Frage
What will be the output
main()
{ int i;
i = 10;
if(i == 20 || 30)
{printf("True");
}
else
{printf("False");
}
}
Antworten
-
True
-
False
-
Syntax Error
-
Run time Error
Frage 29
Frage
What the below statement will print if a=10 and b = 20?
printf("%d",a==b);
Frage 30
Frage
What is the output of the following code?
void main(){
printf("%d%d%d",50,100);
}
Antworten
-
50,100
-
50,100,garbage
-
50,100,0
-
0,50,100
Frage 31
Frage
What is the output of the following program?
void main(){
printf("%d%d",100,200,300);
}
Antworten
-
100 200
-
200 300
-
300 200
-
100 200 300
Frage 32
Frage
What is the output of the following program?
void main(){
printf("2+3=%d",2+3);
}
Antworten
-
2+3=0
-
2+3=2+3
-
2+3=5
-
5=2+3
Frage 33
Frage
What is the output of the following program?
void main(){
int a;
a=3+5*5+3;
printf("%d",a);
}
Frage 34
Frage
what is the output of following program?
void main(){
int a;
float f;
a=12/5;
f=12/5;
printf("%d%f",a,f);
}
Antworten
-
2,2.000000
-
2,2.00
-
2,2
-
none of these
Frage 35
Frage
What is the output of following program?
void main(){
int a;
a='a'>'A';
printf("%d",a);
}
Antworten
-
0
-
1
-
garbage
-
none of these
Frage 36
Frage
What is the output of following program?
void abc(int a){
++a;
}
void main(){
int a=10;
abc();
abc();
printf("%d",a);
}
Frage 37
Frage
What is the output of following program?
void main(){
int i=10;
printf("%d%d%d",++i, i++, ++i);
}
Antworten
-
11 11 13
-
13 11 11
-
11 12 13
-
13 12 11
Frage 38
Frage
what is the output of following program?
void main(){
printf("One");
if(2>1)
printf("Two");
else
printf("Three");
printf("Four");
}
Antworten
-
One Two Three
-
Two Three Four
-
One Two Four
-
One Three Four
Frage 39
Frage
what is the output of following program?
void main(){
float a;
a=6.7;
if(a==6.7)
printf("A");
else
printf("B");
}
Frage 40
Frage
what is the output of following program?
void main(){
int a;
a=10;
a*=10+2;
printf("%d",a);
}
Frage 41
Frage
what is the output of following program?
void main(){
int a;
a=100;
printf("%d%d",++a,a++);
}
Antworten
-
101 101
-
101 102
-
102 100
-
102 101
Frage 42
Frage
What is the output of the following program?
void main(){
int a;
a=100>90>80;
printf("%d",a);
}
Frage 43
Frage
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);
}
Antworten
-
10 10
-
20 10
-
10 20 10
-
10 10 10
Frage 44
Frage
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;
}
Antworten
-
0 1 1 10
-
10 0 1 10
-
1 2 3 4
-
1 1 1 10