Time remaining
:
:
Test Status
CTEST1
Ques 1 :
What will be printed as the result of the operation below.
main()
{
int x=20,y=35;
x=y++ + x++;
y= ++y + ++x;
printf("%d%d",x,y);
}
(A) 5 8 9 4
(B) 5 7 9 4
(C) 5 8 9 5
(D) 5 7 8 4
Ques 2 :
What will be printed as the result of the operation below:
main()
{
int x=5;
printf("%d,%d,%d",x,x<<2,x>>2);
}
(A) 5,21,1
(B) 5,20,1
(C) 5,19,0
(D) 5,19,1
Ques 3 :
Given the following program fragment
main ()
{
int i, j, k;
i = 3;
j =2*(i++);
k =2*(++i);
}
which one of the given option is correct?
(A) j = 6, k = 10.
(B) i = 5, k = 6.
(C) j = 6, k = 8.
(D) i = 4, j = 6.
Ques 4 :
How many times the below loop will run
main()
{
int i;
i=0;
do
{
--i;
printf("%d",i);
i++;
}
while(i>=0);
}
(A) 1
(B) Infinite
(C) 0
(D) Compilation Error
Ques 5 :
switch(option)
{
case 'H' : printf("Hello");
case 'W' : printf("Welcome");
case 'B' : printf("Bye");
break;
}
what would be the output if option = 'H' ?
(A) Hello
(B) Hello Welcome
(C) Hello Welcome Bye
(D) None of the above
Ques 6 :
Suppose a,b,c are integer variables with values 5,6,7 respectively. What is the value of the expression:
!((b+c)>(a+10))
(A) 1
(B) 6
(C) 15
(D) 0
Ques 7 :
Consider the following program,
main ()
{
int i, j;
for (i=0, j=5; j >0, i < 10; i ++, j--)
printf("pskills.org");
}
How many times "pskills.org" will get printed
(A) 5
(B) Compilation Error
(C) 10
(D) None of the above
Ques 8 :
What value of c will get printed
main()
{
int a,b,c;
a=10;
b=20;
c=printf("%d",a)+ ++b;
printf("\n%d",c);
}
(A) 23
(B) 22
(C) 30
(D) Compilation Error
Ques 9 :
How many times the below loop will get executed?
main()
{
int i;
for(i=9;i;i=i-2)
{
printf("\n%d",i);
}
}
(A) 5
(B) 6
(C) Compilation Error
(D) Infinite
Ques 10 :
What the below statement will print if a=10
printf("%d %d",a, !a++);
(A) 11 0
(B) 10 10
(C) 10 0
(D) 0 10
Ques 11 :
What will be the output
main()
{
int i;
i = 10;
if(i == 20 || 30)
{
printf("True");
}
else
{
printf("False");
}
}
(A) True
(B) False
(C) Syntax Error
(D) Run time Error
Ques 12 :
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 13 :
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 14 :
How many times the below loop will get executed?
main()
{
int i;
for(i=20, i=10; i<=20; i++)
{
printf("\n %d", i);
}
}
(A) 1
(B) Run time Error
(C) 11
(D) Compilation Error
Ques 15 :
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 16 :
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++)
{
printf("\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 17 :
Which of the following program structure/component/statement is not an example for implementation of modularization ?
(A) DLL
(B) Functions
(C) type casting
Ques 18 :
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 19 :
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 20 :
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
Submit Answer
Don't Refresh the Page !! ...