(q)What will be output of the following c code?

void main()
{
int a=5,b=6,c=11;
clrscr();
printf("%d %d %d");
getch();
}



output 11 6 5
(q)What will be output of the following c code?
void main()
{
char *str="CQUESTIONBANK";
clrscr();
printf(str+9);
getch();
}



Output: BANK
(q)What will be output of the following c code?
void main()
{
clrscr();
printf("%d",printf("CQUESTIONBANK"));
getch();
}



Output:
CQUESTIONBANK13
(q)What will be output of the following c code?
void main()
{
short int a=5;
clrscr();
printf("%d"+1,a);
getch();
}



Output: d
(q)What will be output of the following c code?
void main()
{
int i=85;
clrscr();
printf("%p %Fp",i,i);
getch();
}



Output:
0055 034E:0055
(q)What will be output of the following c code?
void main()
{
char p[]="ok%s%c%s";
int a=8;
clrscr();
printf(p+2,"mone",a,"key");
getch();
}

(q)What will be output of the following c code?
void main()
{
int a=13;
clrscr();
printf("india%cpak",a);
getch();
}
(q)What will be output of the following c code?
void main()
{
char name1[]="sachin";
char name2[]="al" ;
clrscr();
printf("%s\b\b\b%s",name1,name2);
getch();
}
(q)What will be output of the following c code?
void main()
{
char name1[]="qwertyudgbank";
char name2[]="cquestion" ;
clrscr();
printf("%s\r%s",name1,name2);
getch();
}

0 comments:

Followers

 
C - Programming -