Computer and Programming: C Aptitude Multiple Choice Questions and Answers
Computer and Programming: C Aptitude Multiple Choice Questions and Answers
5+3*2%10-8*6
a) -37
b) -42
c) -32
d) -28
a) error
b) 10
c) 10 10
d) none of these
printf("%X%x%ci%x",11,10,'s',12);
a) error
b) basc
c) Bas94c
d) none of these
a) 1
b) 2
c) infinite number of times
d) none of these
a) 03%D
b) 000
c) 032
d) 321
printf( 3 + "goodbye");
a) goodbye
b) odbye
c) bye
d) dbye
Q9. What will be the output of the following statements ?
a) error
b) garbage value
c) 0
d) 2
#include
void main()
{ int a = 2;
switch(a)
{ case 1:
printf("goodbye"); break;
case 2:
continue;
case 3:
printf("bye");
}
}
a) error
b) goodbye
c) bye
d) byegoodbye
a) error
b) 2
c) 3
d) -3
#include
main()
{
int x,y = 10;
x = y * NULL;
printf("%d",x);
}
a) error
b) 0
c) 10
d) garbage value
a) 88
b) 18
c) 29
d) 19
a) 1
b) 2
c) 6
d) 8
Q15. What will be the output of the following statements ?
int i = 3;
printf("%d%d",i,i++);
a) 34
b) 43
c) 44
d) 33
#include
void main()
{
int a = 36, b = 9;
printf("%d",a>>a/b-2);
}
a) 9
b) 7
c) 5
d) none of these
Q17)
int testarray[3][2][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
What value does testarray[2][1][0] in the sample code above contain?
a) 11
b) 7
c) 5
d) 9
Q18)
void main()
{
int a=10,b=20;
char x=1,y=0;
if(a,b,x,y)
{
printf("EXAM");
}
}
What is the output?
1) XAM is printed
2) exam is printed
3) Compiler Error
4) Nothing is printed
Q19)
1) 10..10
2) 10..50
3) Error
4) 0
Q21)
main()
{
struct
{
int i;
}xyz;
(*xyz)->i=10;
printf("%d",xyz.i);
}
What is the output of this program?
Q22)
What would be the output of the following program?
#include
main()
{
char str[]="S\065AB";
printf("\n%d", sizeof(str));
}
1) 7
2) 6
3) 5
4) error
Q23)
What will be the value of `a` after the following code is executed
#define square(x) x*x
a = square(2+3)
1) 25
2) 13
3) 11
4) 10
Q24)
#include
void func()
{
int x = 0;
static int y = 0;
x++; y++;
printf( "%d -- %d\n", x, y );
}
int main()
{
func();
func();
return 0;
}
Q25)
Q 26)
int i = 4;
switch (i)
{
default:
;
case 3:
i += 5;
if ( i == 8)
{
i++;
if (i == 9) break;
i *= 2;
}
i -= 4;
break;
case 8:
i += 5;
break;
}
printf("i = %d\n", i);
8 comments:
pryoslice said...
Bijendra said...
great work!!
hey pls post the answers also so that the people can check their ans also.
manu088 said...
nitin said...
rajat said...
ujjwala said...
hey change the name or title of the page.... so that people will not try to find
the answers....
varsha said...
Post a Comment
Labels
Arrays (1)
C Aptitude (2)
C Library (1)
C Programming (8)
Computer Networks (1)
Device Drivers (1)
Ebooks (3)
Embedded Developer (4)
English learning (2)
FAQ (1)
Glossary (1)
Good links (1)
Kernel (1)
Network (1)
Sorting (1)
Source Code (1)
TCP/IP (3)
Tutorials (3)
Blog Archive
▼ 2009 (34)
o ► September (4)
o ► August (2)
o ► July (4)
o ► April (2)
o ▼ March (22)
C Programs with Solution Logic
Introduction to Arrays Sorting
C Aptitude Multiple Choice Questions and Answers
C Aptitude Questions and Answers
The OSI Reference Model
Preprocessing in C
Placeholders for Scanf
Other Best Links
Device Drivers
C Library
Linux Kernel
Network Programming
Free Sample Programs
GATE Online Library
Questions and Answers
Unix Shell and Programming Tutorial
Free Ebook Links and Tutorials
PlaceHolders for printf
Facts About Computer and Programming
Important facts in Writing a C Program
Common Mistakes in C
C Operator Precedence
Followers
About Me