Time remaining
:
:
Test Status
CRANDOMTEST
Ques 1 :
What will be printed as the result of the operation below:
main()
{
char s1[]="Cisco"
char s2[]= "systems";
printf("%s",s1);
}
(A) system
(B) error
(C) Cisco
(D) Compilation fail
Ques 2 :
What is the output of the following program?
void main(){
printf("%d%d",100,200,300);
}
(A) 100 200
(B) 200 300
(C) 300 200
(D) 100 200 300
Ques 3 :
What is the output of following program?
void xyz(int b){
++b;
}
void main(){
int b=200;
xyz(b);
xyz(b);
printf("%d",b);
}
(A) 200
(B) 201
(C) 202
(D) 203
Ques 4 :
What will be output of following program?
#include<stdio.h>
int main()
{
int a = 320;
char *ptr;
ptr = (char *)&a;
printf("%d",*ptr);
return 0;
}
(A) 2
(B) 320
(C) 64
(D) Compilation Error
Ques 5 :
What will be output when you will execute following code?
void main(){
int a;
a=5;
if(a=15)
printf("welcome%d",a);
else
printf("hello%d"a);
}
(A) welcome 5
(B) welcome 15
(C) hello 5
(D) hello 15
Ques 6 :
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 7 :
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 8 :
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 9 :
What is the output of following program?
void f1(){
static int s=5;
++s;
printf("%d",s);
}
main(){
f1();
f1();
printf("%d",s);
}
(A) 6 6 6
(B) 6 7 7
(C) 6 7 6
(D) error
Ques 10 :
what is the output of following program?
void main(){
printf("%d%d",47%5,47%-5);
printf("%d%d%d",-47%5,-47%-5,5%7);
}
(A) 2,-2,-2,-2,5
(B) 2,2,-2,-2,5
(C) 2,-2,2,-2,5
(D) 2,2,-2,-2,0
Ques 11 :
What will be output of the following c program?
#include "stdio.h"
int main()
{
int _ = 5;
int __ = 10;
int ___;
___ = _ + __;
printf("%i", ___);
return 0;
}
(A) 5
(B) 10
(C) 15
(D) Compilation Error
Ques 12 :
What will be output when you will execute following code?
static extern int a=5;
static int b=6;
main()
{
printf("%d",a);
printf("%d",b);
return 0;
}
(A) a=0 b=6
(B) a=5 b=0
(C) a=5 b=6
(D) none of these
Ques 13 :
Consider the following program,
main ()
{
int i, j;
for (i=0, j=5; j >0, i < 10; i ++, j--)
printf("\nGyantonic.com");
}
How many times "Gyantonic.com" will get printed
(A) 5
(B) Compilation Error
(C) 10
(D) None of the above
Ques 14 :
What is the output of following program?
void main(){
int a=1;
while(a++<=1)
while(a++<=2);
printf("%d",a);
}
(A) 1
(B) 4
(C) 5
(D) 6
Ques 15 :
int a=10,b;
b=a++ + ++a;
printf("%d,%d,%d,%d",b,a++,a,++a);
what will be the output when following code is executed
(A) 12,11,11,11
(B) 12,10,11,13
(C) 22,10,11,13
(D) 22,13,13,13
Ques 16 :
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 17 :
Which one of the following functions is the correct choice for moving blocks of binary data that are of arbitrary size and position in memory?
(A) memset()
(B) memcpy()
(C) strncpy()
(D) memmove()
Ques 18 :
How many times main() will get called?
main()
{
printf("\n Main Called Again");
main();
}
(A) 1
(B) 100
(C) main can not be called recursively
(D) Infinite
Ques 19 :
What is the output of the following program?
#include "stdio.h"
void fun(int _){
printf("%d",_);
}
main(){
fun(23);
return 0;
}
(A) 0
(B) 23
(C) garbage
(D) error
Ques 20 :
What is the output of following program?
void f1(){
extern int g;
static int s=5;
int a;
++g;
a=s++;
printf("%d%d%d",a,s,g);
if(a<=6)
f1();
printf("%d%d%d",a,s,g);
}
void f2(){
static int s;
int a;
a=++s;
++g;
printf("%d%d%d",a,s,g);
if(a<=2)
f2();
printf("%d%d%d",a,s,g);
}
main(){
f1();
f2();
}
(A) 0 5 garbase
(B) 1 6 1
(C) 1 6 2
(D) error
Submit Answer
Don't Refresh the Page !! ...