Sunteți pe pagina 1din 2

Technical Test - 1

Q5. What will be the output of the following


Topic: Variables, Expressions program?
and Basic I/O void main( )
{
Q1. What will be the output of the following int a=3;
program? printf("%d",a--);
void main( ) }
{ A) 3
printf("%d",printf("Hello")); B) 2
} C) 1
D) 4
A) Abnormal Program Termination.
B) HelloHello Q6. What will be the output of the following
C) 5 program?
D) Hello5 void main()
{
Q2. What will be the output of the following enum week{sun, mon=10, tue=sun+mon-1};
program? printf("%d..%d..%d",sun, mon,tue);
void main( ) }
{ A) Assignment in enum is not possible.
printf("%c",printf("abc")); B) 1..10..10
} C) 0..10..9
A. Abnormal Program Termination. D) None of the above
B. abc65
C. abc Q7. What will be the output of the following
program?
D. Character constant must be one or two void main( )
character long. {
int var1=10,var2=12,var3=12;
Q3. What will be the output of the following var1=var2 = = var3;
program? printf("%d",var1);
void main( ) }
{ A) 12.
int a=15; B) 10
printf("%d",scanf("%d",&a)); C) Invalid Expression
} D) 1
A) Provide user to scan a value if user scans a
number it will return zero. Q8. What will be the output of the following
B) Provide user to scan a value if user scans a program?
number it will return one. void main()
C) Provide user to scan a value if user scans a {
number it will return the same number. int x=-(30*1000+2769);
D) Provide user to scan a value if user scans a printf("%d",x);
number it will return garbage value. }

Q4. What will be the output of the following A) 32767


program? B) -32767
void main( ) C) 32768
{ D) 0
int i=2,j=3,k=4;
int a; Q9. What will be the output of the following
a=(i,k,j); program?
printf("%d",a); int i=2, j, k=2;
} void main()
A) Zero {
B) Abnormal Program Termination. int i;
C) 3 printf("i=%d\t",i);
D) Garbage Value printf("j=%d\t",j);
printf("k=%d\t",k);
Chandigarh Group of Colleges, Landran, Mohali
Technical Test - 1

}
A) i=2 j=0 k=2 }
B) i=2 j=Garbage Value k=2 A) Error : Cannot convert char to char*
C) i=2 j= 0 k=2 B) Punjab
D) i= Garbage Value j=0 k=2 C) Pu
D) n
Q10. What will be the output of the following
program?
#define int int int i,j 14. 1500 is the expected output for the following
void main() code, but the code is not displaying the
{ same.Identify the error.
intint=2; #include<stdio.h>
#include<conio.h>
printf("%d\n",i);
printf("%d\n",j); void main()
} {
A) Garbage value int p,t,si;
Garbage Value float r;
clrscr();
B) Garbage Value p=5000;
2 t=4;
r=7.5;
C) 2 si=(p*r*t)/100;
Garbage Value printf(%f,si);
getch();
}
D) 0
0 15. Identify the error in following code.
Q11. What will be the output of the following #include<stdio.h>
program? #include<conio.h>
void main()
{ void main()
char name; {
name = 'hello'; char name;
printf("%c",name); clrscr();
} name=hello;
A) h printf(%c,name);
B) Error getch();
C) Hello }
D) Garbage Value

Q12. What will be the output of the following


program?
void main()
{
int a=2;
printf("Hello"+a);
}
A) llo
B) Hello2
C) Error : Expression Syntax
D) Error : a must have data type value

Q13. What will be the output of the following


program?
void main()
{
printf("%c", 2["Punjab"]);
Chandigarh Group of Colleges, Landran, Mohali

S-ar putea să vă placă și