×
Login Or SignUp
Privacy Policy
Terms Of Service
freetests4u.com
Online Knowledge Sharing Platform
Login/SignUp
freetests4u.com
Blogs
Mock Tests
Videos
Jobs
11 .
What is the output of the following code ?
#include<`stdio.h`> (Please neglect `` this signs)
void main()
{
int arr[] = {10,20,30,40,50};
int *ptr = arr;
printf(" %d%d",*ptr++,*ptr);
}
A.
10 20
B.
10 10
C.
20 20
D.
20 10
E.
Error
View Answer
Ans: 10 10
12 .
What would be the output of the following program ?
#include <`stdio.h`> (Please neglect `` this signs)
main()
{
printf(" %c", "abcdefgh"[4]);
}
A.
abcdefgh
B.
d
C.
e
D.
error
E.
None of these
View Answer
Ans: e
13 .
What is the output of the following program ?
#include <`stdio.h`> (Please neglect `` this signs)
void main()
{
printf(" 10!=9 : %5d",10!=9);
}
A.
1
B.
0
C.
-1
D.
Error
E.
None of these
View Answer
Ans: 1
14 .
What is the output of the following code ?
#include<`stdio.h`> (Please neglect `` this signs)
void main()
{
int a=14;
a += 7;
a -= 5;
a *= 7;
printf(" %d",a);
}
A.
112
B.
98
C.
86
D.
74
E.
None of these
View Answer
Ans: 112
15 .
#include<`stdio.h`> (Please neglect `` this signs)
main()
{
int *p1,i=25;
void *p2;
p1=&i;
p2=&i;
p1=p2;
p2=p1;
printf("%d",i);
}
The output of the above code is :
A.
25
B.
Garbage value
C.
Address of I
D.
625
E.
Program will not compile
View Answer
Ans: Program will not compile
1
2
3
4
5
6
7
8
9
10
11
12