Time remaining
:
:
Test Status
CRANDOMTEST
Ques 1 :
What will be output when you will execute following c code?
#include<stdio.h>
{
char arr[11]="The African Queen";
printf("%s", arr);
return 0;
}
Choose all that
(A) The African
(B) The
(C) Compilation
(D) None of the aboce
Ques 2 :
What will be the output of the following program if the base address of array is 100.
main()
{
int gyan[] = { 1,2,3,4,5 };
int i,*ptr ;
ptr = gyan;
for(i = 0; i<=4 ; i++)
{
print("\n %d", *ptr++);
}
}
(A) 1 2 3 4 5
(B) 2 3 4 5
(C) 100 101 102 103
(D) 101 102 103 104
Ques 3 :
What will be the output
main()
{
int i, j, *ptr, *ptr1;
i = 10;
j = 10;
ptr = &i;
ptr1 = &j;
if(ptr == ptr1)
{
printf("True");
}
else
{
printf("False");
}
}
(A) True
(B) False
(C) Syntax Error
(D) Run time Error
Ques 4 :
What will be the output of the following program
main( )
{
int pskills[] = { 10, 20, 30, 40, 50 };
int i, *ptr ;
ptr = pskills;
for ( i = 0 ; i <4 ; i++ )
{
fun(ptr++);
printf ("\n%", *ptr ) ;
}
}
void fun(int *i)
{
*i = *i + 1;
}
(A) 11 21 31 41
(B) 20 30 40 50
(C) 21 31 41 51
(D) 10 20 30 40
Ques 5 :
what is the output of following program?
void main(){
float a;
a=6.7;
if(a==6.7)
printf("A");
else
printf("B");
}
(A) A
(B) B
(C) error
(D) nothing display on screen
Ques 6 :
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;
void fun(){
printf("\n in fun a=%d",a);
}
(A) a=5 in fun a=0
(B) a=0 in fun a=5
(C) a=5 in fun a=5
(D) a=0 in fun a=0
Ques 7 :
what is the output of following program?
main(){
int a,b;
a=b=100;
scanf("%d%d",a,&b);
//Entered Values are 40 85
printf("%d %d",a,b);
}
(A) 40 85
(B) 0 85
(C) 100 85
(D) 100 100
Ques 8 :
What will be the output
main()
{
if(1,0)
{
printf("True");
}
else
{
printf("False");
}
}
(A) True
(B) False
(C) Compilation Error
(D) Run time Error
Ques 9 :
What is the output of following program?
void main(){
int a;
a=453<<16;
printf("%d",a);
}
(A) 0
(B) 1
(C) -1
(D) none of these
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 :
what is the output of following program?
void main(){
int a=80;
if(a++>80)
printf("welcome%d",a);
else
printf("hello%d",a);
}
(A) hello 81
(B) welcome 81
(C) hello 80
(D) welcome 80
Ques 12 :
What is the output of following program?
void main(){
printf("%d%d%d",10<<1, 10>>1, ~10);
printf("%d%d%d",10^20, 10|20, 10&20);
}
(A) 20 5 -11 30 30 1
(B) 20 5 -9 30 30 0
(C) 5 20 -11 30 30 0
(D) 20 5 -11 30 30 0
Ques 13 :
What is the output of the following program?
void main(){
int a;
a=100>90>80;
printf("%d",a);
}
(A) 0
(B) 1
(C) error
(D) none of these
Ques 14 :
what is the output of following program?
void main(){
int a;
a=10;
a*=10+2;
printf("%d",a);
}
(A) 102
(B) 100
(C) 120
(D) 22
Ques 15 :
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
(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 16 :
What is the output of following program?
void f1(){
static int s=5;
++s;
printf("%d",s);
}
main(){
f1();
f1();
}
(A) 5 6
(B) 6 6
(C) 6 7
(D) 5 5
Ques 17 :
What is the output of following program?
void f1(){
int a=0;
++a;
printf("%d",a);
}
main(){
int a=10;
f1();
f1();
f1();
printf("%d",a);
return 0;
}
(A) 0 1 1 10
(B) 10 0 1 10
(C) 1 2 3 4
(D) 1 1 1 10
Ques 18 :
what is the output of following program?
void main(){
int a=1;
void xyz(int , int);
xyz(++a,a++);
xyz(a++,++a);
printf("%d",a);
}
void xyz(int x, inty){
printf("%d%d",x,y);
}
(A) 3 1 3 4 5
(B) 3 1 4 4 5
(C) 3 1 4 4 4
(D) 3 1 4 5 5
Ques 19 :
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 20 :
How many variables scopes are there in "C" language?
(A) 2
(B) 3
(C) 4
(D) 5
Submit Answer
Don't Refresh the Page !! ...