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++
-5
1
0
+5
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
switch
goto
go back
return
break
continue
None of these
float
real
int
double
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
2.5
2
2.000000
2.500000
C compiler supports octal integer constant.
C compiler supports hexadecimal integer constant.
C compiler supports binary integer constant.
C compiler supports decimal integer constant.
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.
arr[4]
arr(5)
arr[5]
arr[6]
What is the final value of x when the code is executed?
int x; for(x=0; x<10; x++) {}
10
9
<
=
>=
<=
int a(char *s)
void b(int a[], int n)
float *c()
short d(long x)
4
8
What will the following code print?
int x = 5;if (x = 0)printf("Zero");elseprintf("Not zero");
Zero
Not zero
Compilation error
N=m=0
Value+=10
mySize=x<y?9:11
Value=+=10
Call by reference
Call by value
Call by reference by passing base address to a function
Both A and C
* / % + - =
= * / % + -
/ * % - + =
* % / - + =
Algorithm
Flow-Charts
Procedural
Object Oriented
Using malloc() without free()
Using calloc() without realloc()
Using pointers incorrectly
None of the above
Id_No
ID_NO
IdNo
Id No
*
&
%
#
What will be the output of the following code?
int a = 10, b = 20;printf("%d", a + b);
30
1020
10+20
Compiler error
Either True or False
is less than or is more than
is equal or less or more
All of the above
exit(0)
abort()
All of the mentioned
Depends on the system
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
Constants
Keywords
Operators
Tokens
start()
printf()
main()
getch()
put together the file and functions that are required by the program
translate the instructions into a form suitable for execution by the program
load the executable code into the memory and execute them
allow the user to type the program
5
6
Undefined
printf("\n");
echo '\n';
printf('\n');
printf('\\n')
32
36
40
16
char str[] = "Hello";
char str = "Hello";
string str = "Hello";
char str[] = {'H', 'e', 'l', 'l', 'o'};
int x = 5;if (x > 3) { printf("Greater than 3"); } else { printf("Not greater than 3"); }
Greater than 3
Not Greater than 3
No Output
immutable
mutable
const
volatile
LowerCase letters
UpperCase letters
CamelCase letters
function(int ptr);
function(int *ptr);
function(*ptr);
function(ptr *int);
Nested structure
Recursive structure
Union structure
Inline structure
-1
They can contain alphanumeric characters as well as special characters
It is not an error to declare a variable to be one of the keywords(like goto, static)
Variable names cannot start with a digit
Variable can be of any length
"r"
"w"
"rw"
"read"
for loop
while loop
do-while loop
Program will terminate with an error
Undefined behavior
Array index will wrap around
Logical Operator
Conditional Operator
typecast
Ternary
main function arguments
main arguments
Command-Line arguments
Parameterized arguments
int number;
float rate;
int variable_count;
int $main;