-4
-2.8
+2.8
+3
float_int, keyword, A1
ANSI, ascii, cpu
valid, variable, name
None of the above
Compiler
Interpreter
Assembler
None of These
Logical Operator
Conditional Operator
typecast
Ternary
function(int ptr);
function(int *ptr);
function(*ptr);
function(ptr *int);
30
32
36
40
char str[] = "Hello";
char str = "Hello";
string str = "Hello";
char str[] = {'H', 'e', 'l', 'l', 'o'};
Constants
Keywords
Operators
Tokens
exit
break
continue
return
What will be output if you compile and execute the following ‘C’ code?
void main(){int i=4,x;x=++i + ++i + ++i;printf("%d",x);}
21
18
19
Compilation error
Decimal
Binary
Octal
Hexadecimal
Call by reference
Call by value
Call by reference by passing base address to a function
Both A and C
0
1
-1
Depends on array size
&&
| |
!
All of the above
double
float
char
array
compare two numeric values
combine two numeric values
compare two boolean values
*
+
++
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
for (int i = 0; i < 10; i++)
for i = 0 to 10 step 1
for (i = 0; i < 10; i++)
for (i < 10; i++)
“programming Trick”
“programming"
‘programming'
$ programming $
long double
far double
4 Bytes
8 Bytes
Depends on the system/compiler
Cannot be determined
2.5
2
2.000000
2.500000
float, double
short int, double, long int
float, double, long double
double, long int, float
int number;
float rate;
int variable_count;
int $main;
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
Error
No output
None of these
getchar()
gets()
scanf()
cin.get()
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
static
new
volatile
What is the output of the following code:
int x = 5;
printf("%d", x++);
4
5
6
Undefined
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.
N=m=0
Value+=10
mySize=x<y?9:11
Value=+=10
8
16
Using malloc() without free()
Using calloc() without realloc()
Using pointers incorrectly
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
It breaks out of both loops.
It only breaks out of the innermost loop.
It causes a compile-time error.
It stops the program.
What is the final value of x when the code is executed?
int x; for(x=0; x<10; x++) {}
10
9
ctype.h
stdio.h
conio.h
math.h
int my_num = 100,000;
int my_num = 100000;
int my num = 1000;
int $my_num = 10000;
Assignment Relational Arithmetic
Arithmetic Relational Assignment
Relational Arithmetic Assignment
Assignment Arithmetic Relational
string.h
graphic.h
Algorithm
Flow-Charts
Procedural
Object Oriented
true
friend
export
&
%
#
power of y to the x
power of x to the y
logarithm of x on the base y
Such function does not exist
Nested structure
Recursive structure
Union structure
Inline structure
What is the output of the following code?
main(){ int a, b; a=b=4; b=a++; printf("%d %d %d %d", a++, --b, ++a, b--);}
5 3 7 3
Syntax error
5 4 5 3
6 2 6 4
A
B
ADA
C++
final
constant
const