0 of 100 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
0 of 100 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
CONGRAT
1. What will be the output of the following statement ?
int a=10; printf(“%d &i”,a,10);
2. What will be the output of the following arithmetic expression ?
5+3*2%10-8*6
3 What will be the output of the following statement ?
printf(“%X%x%ci%x”,11,10,’s’,12);
4. What will be the output of the following statements ?
int a = 4, b = 7,c; c = a = = b; printf(“%i”,c);
5. What will be the output of the following statements ?
int a = 5, b = 2, c = 10, i = a>b
void main()
{ printf(“hello”); main(); }
6. What will be output if you will compile and execute the following c code?
struct marks{
int p:3;
int c:3;
int m:2;
};
void main(){
struct marks s={2,-6,5};
printf(“%d %d %d”,s.p,s.c,s.m);
}
7. What will be the output of the following statements ?
int x[4] = {1,2,3}; printf(“%d %d %d”,x[3],x[2],x[1]);
8. What will be the output of the following statement ?
printf( 3 + “goodbye”);
9. What will be the output of the following statements ?
long int a = scanf(“%ld%ld”,&a,&a); printf(“%ld”,a);
10. What will be the output of the following program ?
#include
void main()
{ int a = 2;
switch (A)
{ case 1:
printf(“goodbye”); break;
case 2:
continue;
case 3:
printf(“bye”);
}
}
11. What will be the output of the following statements ?
int i = 1,j; j=i— -2; printf(“%d”,j);
12. What will be the output of following program ?
#include
main()
{
int x,y = 10;
x = y * NULL;
printf(“%d”,x);
}
13. What will be the output of following statements ?
char x[ ] = “hello hi”; printf(“%d%d”,sizeof(*x),sizeof(x));
14. What will be the output of the following statements ?
int a=5,b=6,c=9,d; d=(ac?1:2):(c>b?6:8)); printf(“%d”,d);
15. What will be the output of the following statements ?
int i = 3;
printf(“%d%d”,i,i++);
16. What will be the output of the following program ?
#include
void main()
{
int a = 36, b = 9;
printf(“%d”,a>>a/b-2);
}
17. int testarray[3][2][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
What value does testarray[2][1][0] in the sample code above contain?
18 .What is the output?
void main()
{
int a=10,b=20;
char x=1,y=0;
if(a,b,x,y)
{
printf(“EXAM”);
}
}
19. What is the output of the following code?
#include
void main()
{
int s=0;
while(s++<10)>
# define a 10
main()
{
printf(“%d..”,a);
foo();
printf(“%d”,a);
}
void foo()
{
#undef a
#define a 50
}
20 What is the output of this program?
main()
{
struct
{
int i;
}xyz;
(*xyz)->i=10;
printf(“%d”,xyz.i);
}
21. What would be the output of the following program?
#include
main()
{
char str[]=”S\065AB”;
printf(“n%d”, sizeof(str));
}
22.What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?
23. What will be the value of `a` after the following code is executed
#define square(x) x*x
a = square(2+3)
24 What will the code below print when it is executed?
#include
void func()
{
int x = 0;
static int y = 0;
x++; y++;
printf( “%d — %dn”, x, y );
}
int main()
{
func();
func();
return 0;
}
25. With what do you replace the ???? to make the function shown below return the correct answer?
long factorial (long x)
{
????
return x * factorial(x – 1);
}
26. What is printed when the sample code below is executed?
int y[4] = {6, 7, 8, 9};
int *ptr = y + 2; printf(“%dn”, ptr[ 1 ] );
27. What will the output of the sample code below be?
int i = 4;
switch (i)
{
default: ;
case 3:
i += 5;
if ( i == 8)
{
i++;
if (i == 9) break;
i *= 2;
}
i -= 4;
break;
case 8:
i += 5;
break;
}
printf(“i = %dn”, i);
28. What will be output if you will compile and execute the following c code?
void main()
{
if(printf(“cquestionbank”))
printf(“I know c”);
else
printf(“I know c++”);
}
29.What will be output if you will compile and execute the following c code?
#define call(x) #x
void main(){
printf(“%s”,call(c/c++));
}
30. What will be output if you will compile and execute the following c code?
#define message “union is
power of c”
void main()
{
clrscr();
printf(“%s”,message);
getch();
}
31. What will be output if you will compile and execute the following c code?
void main(){
int a=25;
clrscr();
printf(“%o %x”,a,a);
getch();
}
32. What will be output if you will compile and execute the following c code?
void main()
{
int i=0;
if(i==0){
i=((5,(i=3)),i=1);
printf(“%d”,i);
}
else
printf(“equal”);
}
33.What will be output if you will compile and execute the following c code?
int extern x;
void main()
printf(“%d”,x);
x=2;
getch();
}
int x=23;
34.What will be output if you will compile and execute the following c code?
void main(){
int a,b;
a=1,3,15;
b=(2,4,6);
clrscr();
printf(“%d “,a+b);
getch();
}
35.What will be output if you will compile and execute the following c code?
void main(){
static main;
int x;
x=call(main);
clrscr();
printf(“%d “,x);
getch();
}
int call(int address){
address++;
return address;
}
35.What will be output if you will compile and execute the following c code?
#include “string.h”
void main(){
clrscr();
printf(“%d %d”,sizeof(“string”),strlen(“string”));
getch();
}
37. Write c program to print “hello” without using ; (semicolon)
Upload your answer to this question.
This response will be reviewed and graded after submission.
38- What is the output of the following code snippet?
#include<stdio.h>
main()
{
const int a = 5;
a++;
printf(“%d”, a);
}
39. Which operator is used to continue the definition of macro in the next line?
40. Function fopen() with the mode “r+” tries to open the file for _______.
41.What is the output of the following program?
#include<stdio.h>
void swap(int m, int n)
{
int x = m;
m = n;
n = x;
}
main()
{
int x=5, y=3;
swap(x,y);
printf(“%d %d”, x, y);
}
42. Identify the incorrect file opening mode from the following.
43 What is the output of the following program?
#include<stdio.h>
void f()
{
static int i;
++i;
printf(“%d”, i);
}
main()
{
f();
f();
f();
}
44. What is the output of the below code snippet?
#include<stdio.h>
main()
{
unsigned x = 5, y=&x, *p = y+0;
printf(“%u”,*p);
}
45.What is the output of the following code snippet?
#include<stdio.h>
main()
{
char c = ‘A’+255;
printf(“%c”, c);
}
46. The type name/reserved word ‘short’ is _______.
47. int x=~1; What is the value of ‘x’?
48.What is your comment on the below C statement?
signed int *p=(int*)malloc(sizeof(unsigned int));
49. Identify the invalid constant used in fseek() function .
50.What is the size of ‘int’?
51.
What is the output of the below code snippet?
#include<stdio.h>
main()
{
int a = 1;
float b = 1.3;
double c;
c = a + b;
printf(“%.2lf”, c);
}
52.What is the size of the following union definition?
#include<stdio.h>
union abc {
char a,b,c,d,e,f,g,h;
int i;
}abc;
main()
{
printf( “%d”, sizeof( abc ));
}
53. What is the output of the following program?
#include<stdio.h>
main()
{
int r, x = 2;
float y = 5;
r = y%x;
printf(“%d”, r);
}
54. What is the output of the following program?
#include<stdio.h>
main()
{
int x = 65, *p = &x;
void *q=p;
char *r=q;
printf(“%c”,*r);
}
55.What is the output of the following code snippet?
#include<stdio.h>
main()
{
short unsigned int i = 0;
printf(“%u\n”, i–);
}
56.What is the output of the following program?
#include<stdio.h>
main()
{
enum { india, is=7, GREAT };
printf(“%d %d”, india, GREAT);
}
57.What is the output of the following program?
#include<stdio.h>
main()
{
register int x = 5;
int *p;
p=&x;
x++;
printf(“%d”,*p);
}
58.
What is the output of the below code snippet?
#include<stdio.h>
main()
{
char s[]=”hello”, t[]=”hello”;
if(s==t){
printf(“eqaul strings”);
}
}
59.What is the output of the below code snippet?
#include<stdio.h>
main()
{
int a = 5, b = 3, c = 4;
printf(“a = %d, b = %d\n”, a, b, c);
}
60.What is the output of the following code snippet?
#include<stdio.h>
main()
{
int const a = 5;
a++;
printf(“%d”,a);
}
}
61. Who is father of C Language?
62. C Language developed at _____?
63. For 16-bit compiler allowable range for integer constants is ______ ?
64. C programs are converted into machine language with the help of
65. A C variable cannot start with
66. Which of the following is allowed in a C Arithmetic instruction
67. Which of the following shows the correct hierarchy of arithmetic operations in C
68. What is an array?
69. What is right way to Initialization array?
70. An array elements are always stored in _________ memory locations.
71. What is the right way to access value of structure variable book{ price, page }?
72. perror( ) function used to ?
73. Bitwise operators can operate upon?
74. What is C Tokens?
75. What is Keywords?
77. What is constant?
78. Which is the right way to declare constant in C?
79. Which operators are known as Ternary Operator?
80. In switch statement, each case instance value must be _______?
81. What is the work of break keyword?
82. What is function?
82. Which one of the following sentences is true ?
83. A binary tree with 27 nodes has _______ null branches.
84. Which one of the following is not a linear data structure?
85. Recursive functions are executed in a?
86. Queue is a _____________ list.
87. The statement print f (“%d”, 10 ? 0 ? 5 : 1 : 12); will print?
88. To represent hierarchical relationship between elements, which data structure is suitable?
89. Which of the following data structure is linear type?
90. The statement printf(“%c”, 100); will print?
91. The _______ memory allocation function modifies the previous allocated space.
92. Number of binary trees formed with 5 nodes are
93. The “C” language is
94. The worst case time complexity of AVL tree is better in comparison to binary search tree for
95. In which tree, for every node the height of its left subtree and right subtree differ almost by one?
96. C is ______ Language?
97. The Default Parameter Passing Mechanism is called as
98. The Default Parameter Passing Mechanism is called as
99. In which linked list last node address is null?
100. Which is the correct syntax to declare constant pointer?