fclose()
closefile()
fileclose()
endfile()
What is the output of the following code?
int x = 5;if (x > 3) { printf("Greater than 3"); } else { printf("Not greater than 3"); }
Greater than 3
Not Greater than 3
Error
No Output
char str[] = "Hello";
char str = "Hello";
string str = "Hello";
char str[] = {'H', 'e', 'l', 'l', 'o'};
int a = 5, b = 10;if (a < b)printf("a is less than b");elseprintf("a is greater than or equal to b");
a is greater than or equal to b
a is less than b
Compiler Error
Undefined
-4
-2.8
+2.8
+3
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
getchar()
gets()
scanf()
cin.get()
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
30
32
36
40
Binary operator
Unary operator
Ternary operator
All of the above
return
static
new
volatile
int num;
integer num;
num int;
num integer;
Id_No
ID_NO
IdNo
Id No
Keywords can be used as variable names
Variable names can contain digits
Variable names do not contain blank spaces
Capital letters can be used in variable names.
1
-1
0
2
How many times will the following loop execute?
int j;for(j = 1; j <= 10; j = j-1)printf("INFOMAX");
Forever
Never
10
break stops the loop, continue skips the rest of the iteration
Both stop the loop
break skips to the next iteration, continue exits the loop
Both skip to the next iteration
function(int ptr);
function(int *ptr);
function(*ptr);
function(ptr *int);
compare two numeric values
combine two numeric values
compare two boolean values
None of the above
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..
To exit the function and return control to the calling function
To pause the function temporarily
To call the function again
To exit the program
4 Bytes
8 Bytes
Depends on the system/compiler
Cannot be determined
Bjarne Stroustrup
James A. Gosling
Dennis Ritchie
Dr. E.F. Codd
int a(char *s)
void b(int a[], int n)
float *c()
short d(long x)
Using malloc() without free()
Using calloc() without realloc()
Using pointers incorrectly
Nested structure
Recursive structure
Union structure
Inline structure
What will be the output of the following code?
int a = 10, b = 20;printf("%d", a + b);
1020
10+20
Compiler error
What will be the output of the following program?
int main() { int x=5; printf(“%d %d %d”,x,x<<2,x>>2); }
1 20 5
5 1 20
5 20 1
20 1 5
A number
A special symbol other than underscore
Both of the above
An alphabet
What will be the output of following program?
int main() { for(int c=1;c<5;++c); printf(“%d”,c); }
5
6
12345
Return
GOTO
Switch
exit
It breaks out of both loops.
It only breaks out of the innermost loop.
It causes a compile-time error.
It stops the program.
int my_num = 100,000;
int my_num = 100000;
int my num = 1000;
int $my_num = 10000;
do-while
if-else
for
while
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
-5
+5
int x = 5;printf("%d", ++x);
4
7
infomax
info_max
info max
All of these
*
+
++
&&
Depends on the system
for loop
while loop
do-while loop
| |
!
Spaces
Digits
Underscores
Letters
//
/
#
/*
-3.4e38 to 3.4e38
-32767 to 32768
-32668 to 32667
-32768 to 32767
int
float
include
char
20
None
Both can occur multiple times, but a declaration must occur first.
A definition occurs once, but a declaration may occur many times.
Both can occur multiple times, but a definition must occur first.
A declaration occurs once, but a definition may occur many times.
An Editor
A compiler
An operating system
None of these
for (i=1; i < 20; i++) printf ("k");
for (i=1; i = 20; i++) printf ("k");
for (i=0; i < 20; i++) printf ("k");
for (i=0; i <= 20; i++) printf ("k");