C Programming
C Programming
a) 4
b) 8
c) 14
d) compilation error
.
a) 15
b) 16
c) 17
d) 18
.
a) 0
b) -1
c) 1
d) Garbage
.
4) What is the output of the following code?
a) a after loop
b) a a after loop
c) after loop
d) None of the mentioned
.
6) What is the output of this C code?
7) What will be output if you will compile and execute the following c code?
a) 2 -6 5
b) 2 -6 1
c) 2 2 1
d) Compiler error
.
8) What will be output if you will compile and execute the following c code?
a) 0 0 0 0
b) Garbage Value
c) 102 56 -80 32
d) 102 102 -90 64
.
9) What will be output if you will compile and execute the following c code?
a) c question bank
b) c
c) bank
d) cquestionbank
.
11) What will be output if you will compile and execute the following c code?
a) c-pointer
b) c-point
c) cpointer null null
d) c-point
.
12) What will be output if you will compile and execute the following c code?
a) 0
b) 1
c) Garbage value
d) Compiler error
.
13) What will be output if you will compile and execute the following c code?
a) 3
b) 21
c) 17
d) 7
.
14) What will be output if you will compile and execute the following c code?
a) 0
b) 2
c) 23
d) Compiler error
.
15) What will be output if you will compile and execute the following c code?
a) 5
b) 3
c) 1
d) equal
.
16) What will be output if you will compile and execute the following c code?
a) 25 25
b) 025 0x25
c) 12 42
d) 31 19
.
17) What will be output if you will compile and execute the following c code?
a) union is power of c
b) unionispower of c
c) union is Power of c
d) Compiler error
.
18) When new data are to be inserted into a data structure, but there is no available space; this situation is
usually called____________.
a) underflow
b) overflow
c) houseful
d) saturated
.
19)
a) Google 35000.000000
b) TCS 15000.000000
c) IBM 25000.000000
d) null 15000.000000
e) Google null
.
20)
a) 2 98 3 513 29 73 0 -1
b) 2 98 3 513 30 73 1 -1
c) 2 99 3 513 29 73 1 -1
d) 2 98 3 513 29 73 1 -1
e) Compilation error
.
Question 1
Question 2
#include<stdio.h>
int main()
{
typedef int arr[5];
arr arr1 = {10,20,30,40,50};
int i;
for(i=0; i<4; i++)
printf("%d,", arr1[i]);
return 0;
}
Choices (With Correct Answers)
10, 20, 30, 40
10, 20, 30, 40, 50
No output
Error: Cannot use typedef with an array
Question 3
Question 4
#include <stdio.h>
void main()
{
int x = 97;
int y = sizeof(x++);
printf("y is %d", y);
}
Choices (With Correct Answers)
4
5
97
Compilation Error
Question 5
Question 6
Question 7
#include<stdio.h>
#include<stdarg.h>
Question 8
What value strcmp() function returns when two strings are the same?
Choices (With Correct Answers)
0
1
0.5
2
Question 9
#include<stdio.h>
main()
{
FILE *stream=fopen("a.txt",'r');
}
Choices (With Correct Answers)
Trying to open “a.txt” in read mode
Trying to open “a.txt” in write mode.
Compile error
“stream” is an invalid identifier
Question 10
#include<stdio.h>
#include<string.h>
void fun(char *p)
{
p=(char *) malloc(6);
strcpy(p,"Code");
}
void main( )
{
char *p="Ground";
fun(p);
printf("%s",p);
}
Choices (With Correct Answers)
Code
Ground
CodeGround
Compilation Error
Question 11
#include<stdio.h>
void main()
{
int code[]={1,2,3,4};
printf("%d", -2[code]);
}
Choices (With Correct Answers)
0
-6
-3
Compilation Error
Question 12
What will be the output when you execute the following c code?
#include<stdio.h>
void main()
{
int const SIZE=5;
int expr;
double value[SIZE]={2.0,4.0,6.0,8.0,10.0};
expr=1|2|3|4;
printf("%f",value[expr]);
}
Choices (With Correct Answers)
2.000000
4.000000
8.000000
Compilation Error
Question 13
What is the output when you compile and run the code?
#include<stdio.h>
void main()
{
printf("%d",printf("CODEGROUND"));
getch();
}
Choices (With Correct Answers)
CODEGROUND12
CODEGROUND11
CODEGROUND10
Compilation Error
Question 14
#include<stdio.h>
int main()
{
int printf=12;
printf("%d",printf);
return 0;
}
Choices (With Correct Answers)
12
Compilation Error
0
5
Question 15
#include<stdio.h>
int main(){
int _=3;
int __=9;
int ___;
___=_+__;
printf("%i",___);
return 0;
}
Choices (With Correct Answers)
9
15
12
Compilation Error
Question 16
what will be the output of the code ?
#include <stdio.h>
#define MULTIPLY(a, b) a*b
int main()
{
printf("%d", MULTIPLY(3+6,2+3));
return 0;
}
Choices (With Correct Answers)
12
45
18
21
Question 17
Question 18
#include<stdio.h>
int main()
{
double num=6.9;
int var=4;
printf("%d\t",sizeof(!num));
printf("%d\t",sizeof(var=12/2));
printf("%d",var);
return 0;
}
Choices (With Correct Answers)
426
444
225
246
Question 20
#include<stdio.h>
int main()
{
printf("%d\t",sizeof(90000));
printf("%d\t",sizeof(18.5));
printf("%d",sizeof('C'));
return 0;
}
Choices (With Correct Answers)
442
884
484
844