Time remaining
:
:
Test Status
CTEST2
Ques 1 :
Which one of the given option is correct?
void main()
{
int i;
i=2;
pskills:
printf("%d",i);
i=i+2;
if(i<=20)
goto pskills;
}
(A) 3 5 7 9 ....... 21 23
(B) 2 4 6 8 ....... 20
(C) 3 5 7 9 ....... 21
(D) 2 4 6 8 ....... 20 22
Ques 2 :
What will be the output of the following program?
main()
{
printf(3+"Proskills"+4);
}
(A) Compilation Error
(B) skills
(C) kills
(D) ls
Ques 3 :
What will be the output of the following program?
main()
{
printf("%c","Pskills"[4]);
}
(A) Compilation Error
(B) P
(C) i
(D) l
Ques 4 :
What value of c will get printed
main()
{
int a, b, c;
a = 10;
b = 20;
c = printf("%d",a) + ++b;
printf ("%d",c);
}
(A) 23
(B) 22
(C) 30
(D) Compilation Error
Ques 5 :
What will be the output
main()
{
int i;
i = 10;
printf("%d\t",5,6);
printf("%d", i , i++);
}
(A) 5 11
(B) 6 10
(C) 6 11
(D) 5 10
Ques 6 :
What the below statement will print if a=10 and b = 20?
printf("%d",a==b);
(A) 20
(B) 10
(C) 1
(D) 0
Ques 7 :
How many times the below loop will get executed?
main()
{
int i,j;
i = 10;
for (j=i==10 ; j<=10 ; j++)
{
printf("\n%d",j);
}
}
(A) 1
(B) 10
(C) 11
(D) Compilation Error
Ques 8 :
How many times the while loop will get executed?
main ( )
{
int a = 1 ;
while ( a <= 100) ;
{
printf ( "%d", a++ ) ;
}
}
(A) 100
(B) 1
(C) 0
(D) Infinite
Ques 9 :
What will be the output
main()
{
char *ptr = "Pskills.org";
char a =
printf("%c", ++*ptr++);
}
(A) Compilation Error
(B) Q
(C) P
(D) a
Ques 10 :
What are storage classes in 'C' language? choose multiple-
a. auto keyword
b. static keyword
c. register keyword
d. extern keyword
e. automatic
f. static
(A) a,b,c
(B) a,b,c,d
(C) e,f
(D) none of these
Ques 11 :
How many storage class specifiers in "C" language?
(A) 3
(B) 4
(C) 5
(D) 6
Ques 12 :
How many variables scopes are there in "C" language?
(A) 2
(B) 3
(C) 4
(D) 5
Ques 13 :
What is the output of the following code?
#include "stdio.h"
main()
{
int i;
for(i=0;i<5;i++)
{
static int a=0;
int b=0;
a++;
b++;
printf("%d %d",a,b);
}
return 0;
}
(A) 1 1 2 1 3 1 4 1 4 1
(B) 1 1 2 1 3 1 4 1 5 1
(C) 1 0 2 0 3 1 4 1 5 1
(D) 0 1 2 0 3 1 4 1 5 1
Ques 14 :
What is the output of the following code?
#include "stdio.h"
main(){
static int s;
++s;
printf("%d",s);
if(s<=3)
main();
printf("%d",s);
return 0;
}
(A) 1 2 3 4 4 4 4 4
(B) 0 1 2 3 4 4 4 4
(C) 1 2 3 3 4 4 4 4
(D) 0 1 3 4 4 4 4 4
Ques 15 :
What is the output of the following code?
#include "stdio.h"
extern int a;
main(){
printf("\na=%d",a);
return 0;
}
(A) a=0
(B) a=garbage value
(C) error
(D) none of these
Ques 16 :
What is the output of the following code?
#include "stdio.h"
int a;
main(){
printf("\n a= %d",a);
return 0;
}
(A) a=0
(B) a=garbage value
(C) error
(D) none of these
Ques 17 :
What is the output of the following code?
#include "stdio.h"
extern int a;
main(){
printf("\n a=%d",a);
return 0;
}
int a;
(A) a=0
(B) error
(C) nothing display on screen
(D) none of these
Ques 18 :
What is the output of the following code?
#include "stdio.h"
extern int a;
main(){
printf("\n a=%d",a);
return 0;
}
int a=5;
(A) a=0
(B) a=5
(C) a=garbage value
(D) error
Ques 19 :
What is the output of the following code?
#include "stdio.h"
extern int a=5;
main(){
void fun();
printf("\n a=%d",a);
fun();
return 0;
}
int a;
void fun(){
printf("\n in fun a=%d",a);
}
(A) a=0 in fun a=5
(B) a=5 in fun a=0
(C) a=5 in fun a=5
(D) error
Ques 20 :
What is the output of the following code?
#include "stdio.h"
extern int a;
main(){
void fun();
printf("\n a=%d",a);
fun();
return 0;
}
int a=7;
void fun(){
printf("\n in fun a=%d",a);
}
(A) a=0 in fun a=0
(B) a=7 in fun a=7
(C) a=7 in fun a=0
(D) error
Submit Answer
Don't Refresh the Page !! ...