What is the final value of x when the code is executed?
int x; for(x=0; x<10; x++) {}
10
9
0
1
void
endl
float
switch
When the following piece of code is executed, what happens?
b = 3;a = b++;
a contains 3 and b contains 4
a contains 4 and b contains 4
a contains 4 and b contains 3
a contains 3 and b contains 3
What will the following code print?
int x = 5;if (x = 0)printf("Zero");elseprintf("Not zero");
Zero
Not zero
Compilation error
Error
auto
case
main
default
C compiler supports octal integer constant.
C compiler supports hexadecimal integer constant.
C compiler supports binary integer constant.
C compiler supports decimal integer constant.
An Editor
A compiler
An operating system
None of these
ceil(1.66)
floor(1.66)
roundup(1.66)
roundto(1.66)
It exits the current loop and continues with the next iteration
It terminates the current loop and transfers control to the next statement after the loop
It skips the current iteration and moves to the next iteration
It repeats the current iteration
stdio.h
conio.h
stdlib.h
Read
Write
Execute
Copy
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.
strlen()
sizeof()
length()
strlength()
break
exit(0)
abort()
All of the mentioned
Constants
Keywords
Operators
Tokens
for loop
while loop
do-while loop
none of the above
char str[] = "Hello";
char str = "Hello";
string str = "Hello";
char str[] = {'H', 'e', 'l', 'l', 'o'};
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
double
long double
far double
Binary operator
Unary operator
Ternary operator
All of the above
Return
GOTO
Switch
exit
What is the output of the following code:
int x = 5;
printf("%d", x++);
4
5
6
Undefined
//
/
#
/*
&
&&
||
!
print("Hello World");
echo("Hello World");
printf("Hello World");
| |
continue
return
Call by reference
Call by value
Call by reference by passing base address to a function
Both A and C
do-while
if-else
for
while
2 bytes
4 bytes
8 bytes
1 byte
They execute programs faster than compilers
They translate the entire program at once
They translate and execute code line by line
They are not used in modern programming
2
3
What is the output of the following code?
int arr[5] = {1, 2, 3, 4, 5};printf("%d", arr[3]);
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
scanf()
getch()
getche()
gets()
-5
+5
pair of parenthesis
semicolon
braces
colon
None of the above
char > int > float
int > char > float
char < int < double
double > char > int
Logical Operator
Conditional Operator
typecast
Ternary
An array of characters
The object of some class
Same as other primitive data type
Linkedlist of characters
world
addition23
test-name
factorial
no of students
char
7th
myName
Algorithm
Flow-Charts
Procedural
Object Oriented
Depends on the system
Decimal
Binary
Octal
Hexadecimal
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
A number
A special symbol other than underscore
Both of the above
An alphabet
int my_num = 100,000;
int my_num = 100000;
int my num = 1000;
int $my_num = 10000;
goto
go back