C new placement papers questions and answers. It is model or sample test questions and answers in c programming language
(1) What will be output of the following program ?
void main()
{ int i;
clrscr();
printf("india"-'A'+'B');
getch();
}
(2)What will be output of the following program ?
void main()
void main()
{ int i;
clrscr();
printf(5+"Raja hindustani");
getch();
}
(3) What will be output of the following program ?
void main()
void main()
{
clrscr();
printf("\ttare\bjamin\0par");
getch();
}
}
(4) What will be output of the following program ?
void main()
{
clrscr();
if(sizeof(!6.0))
printf("%d",sizeof(6.0,2));
else
printf("i don't know");
getch();
}
(5) What will be output of the following program ?
void main()
{
clrscr();
printf("RAJA HINDUSTANI"+'\11');
getch();
}
(6) What will be output of the following program ?
void main()
{
const int p=60;
(int)p=40;
clrscr();
printf("%d",p);
getch();
}
(7) What will be output of the following program ?
void main()
{
const int i=60;
int *p;
p=&i;
*p=40;
clrscr();
printf("%d",i);
getch();
}
(8) What will be output of the following program ?
void main()
{
char a=256;
int b=2;
int c;
c=a+b;
clrscr();
printf("%d",c);
getch();
}
(9) What will be output of the following program ?
void main()
{
float a=3.4;
int b=2;
int c;
c=a+b;
clrscr();
printf("%d",c);
getch();
}
(10) What will be output of the following program ?
void main()
{
int i=66,x=-3;
clrscr();
printf((x>0)?"%d":"%c",i);
getch();
}
Solution or answers:
(1) ndia
(2) hindustani
(3) tarjamin
(4) 2
(5) USTANI
(6) 40
(7) 40
(8) 5538
(9) 5
(10) B
No comments:
Post a Comment