Compiler
Interpreter
Assembler
None of These
2
4
1
Depends on the system
What will be the output of the following code segment?
int x = 24, y = 39, z = 45;z = x + y;y = z - y;x = z - y;printf("\n%d %d %d", x, y, z);
24 39 63
39 24 63
24 39 45
39 24 45
What will be the output of the following code?
int main(){int x,y,z;x='1'-'0'; /* line-1 */y='a'-'b'; /* line-2 */z=x+y;printf("%d",z);}
0
Error because of incorrect line-1 only.
Error because of incorrect line-1 and line-2.
Error because of incorrect line-2 only.
30
32
36
40
break
exit(0)
abort()
All of the mentioned
10
20
None
N=m=0
Value+=10
mySize=x<y?9:11
Value=+=10
print("Hello World");
echo("Hello World");
printf("Hello World");
None of these
-4
-2.8
+2.8
+3
final
constant
const
static
What will the following code print?
int x = 5;if (x = 0)printf("Zero");elseprintf("Not zero");
Zero
Not zero
Compilation error
Error
no of students
char
7th
myName
it Compare the variable a and the variable b are same.
The value of b is assigned to variable a but if b changes later, it will not effect the value of variable a.
The value of b is assigned to variable a but if b changes later, it will effect the value of variable a.
The value of variable a is assigned to variable b, and the value of variable b is assigned to variable a.
What will be output if you will compile and execute the following c code?
int main(){ int a=5; float b; printf("%d",sizeof(++a+b)); printf(" %d",a); return 0;}
2 6
4 6
2 5
4 5
It is used to define global variables
It is used to define a macro
It is used to include standard or user-defined header files in the program
It is used to include comments in the code
Martin Richards
Dennis Ritchie
Ken Thompson
Herman Hellorith
world
addition23
test-name
factorial
2.5
2.000000
2.500000
printf("\n");
echo '\n';
printf('\n');
printf('\\n')
int
float
double
is executed only once if the condition is true.
is also known as entry-controlled loop.
is executed at least once if the condition is false.
is unconditional looping statement..
The basic data type of C
Qualifier
Short is the qualifier and int is the basic data type
What will be the output of following program?
int main() { for(int c=1;c<5;++c); printf(“%d”,c); }
5
6
12345
What is the output of the following code?
int a = 10, b = 5;printf("%d", a / b);
0.5
15
int func();
func() int;
function int func();
declare int func();
return
new
volatile
conio.h
string.h
math.h
graphic.h
float, double
short int, double, long int
float, double, long double
double, long int, float
array
2 bytes
4 bytes
8 bytes
1 byte
do-while
if-else
for
while
Bjarne Stroustrup
James A. Gosling
Dr. E.F. Codd
-1
Null
EOF
Value of elements in array
First element of the array
Base address of the array
Address of the last element of array
signed short
unsigned short
long
print()
scanf()
input()
All of the above
A number
A special symbol other than underscore
Both of the above
An alphabet
An Editor
A compiler
An operating system
Depends on array size
What will be the output of the following pseudo code ?
Integer aSet a =4do print a + 2 a = a-1while (a not equals 0)end while
6 6 6 6
6 5 4 3
6 7 8 9
6 8 10 12
What is the output of this statement
printf("%d", (a++));
The value of (a + 1)
Error message
Garbage
The current value of a
1return
return1
$return_1
A
B
ADA
C++
char str[] = "Hello";
char str = "Hello";
string str = "Hello";
char str[] = {'H', 'e', 'l', 'l', 'o'};
“programming Trick”
“programming"
‘programming'
$ programming $
In the following nested conditional statements, which branch will execute?
int x = 4;if (x > 2) { if (x < 5) { printf("x is between 2 and 5"); }} else { printf("x is 2 or less");}
x is between 2 and 5
x is 2 or less
No output
An array of characters
The object of some class
Same as other primitive data type
Linkedlist of characters
Addition, Division, Modulus
Addition, Modulus, Division
Multiplication, Substration, Modulus
Modulus, Multiplication, Substration
int a = 5;printf("%d", a == 5);
Undefined