#include
#include void main()
{
int a=5,b=6,c=11; clrscr(); printf("%d %d %d"); getch(); }
What will output when you compile and run the above code?
a) Garbage value garbage value garbage value
b) 5 6 11
c) 11 6 5
d) Compiler error
2.
#include
void main()
{
char *str="CQUESTIONBANK"; clrscr(); printf(str+9); getch(); }
What will output when you compile and run the above code?
(a)CQESTIONBANK
(b)CQUESTION
(c)BANK
(d)Compiler error
3.
#include
void main()
{
clrscr(); printf("%d",printf("CQUESTIONBANK")); getch();
}
What will output when you compile and run the above code?
(a)13CQUESTIONBANK
(b)CQUESTIONBANK13
(c)Garbage CQUESTIONBANK
(d)Compiler error
4.
#include
#include void main()
{
short int a=5; clrscr(); printf("%d"+1,a); getch(); }
What will output when you compile and run the above code?
(a)6
(b)51
(c)d
(d)Compiler error
5.
#include
void main()
{
int i=85; clrscr(); printf("%p %Fp",i,i); getch(); }
What will output when you compile and run the above code?
(a)85 85
(b)0055 034E:0055
(c)0055 FFFF:0055
(d)Compiler error
6.
#include
static struct student
{
int a; int b; int c; int d;
}s1={6,7,8,9},s2={4,3,2,1},s3;
void main()
{
s3=s1+s2; clrscr(); printf("%d %d %d %d",s3.a,s3.b,s3.c,s3.d); getch(); }
What will output when you compile and run the above code?
(a)6789
(b)4321
(c)10101010
(d)Compiler error
7.
#include
extern struct student
{
int a; int b; int c; int d;
}s={6,7,8,9};
void main()
{
clrscr(); printf("%d %d %d %d",s.a,s.b,s.c,s.d); getch(); }
What will output when you compile and run the above code?
(a)6789
(b)9876
(c)0000
(d)Compiler error
8.
#include
struct student
{
static int a; register int b; auto int c; extern int d;
}s={6,7,8,9};
void main()
{
printf("%d %d % %d",s.a,s.b,s.c,s.d);
}
What will output when you compile and run the above code?
(a)6789