int number;
float rate;
int variable_count;
int $main;
1
-1
0
2
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.
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
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
break
continue
return
exit
Depends on array size
scanf()
getch()
getche()
gets()
float_int, keyword, A1
ANSI, ascii, cpu
valid, variable, name
None of the above
do-while
if-else
for
while
float, double
short int, double, long int
float, double, long double
double, long int, float
is executed only once if the conditions is true
is also known as entry-controlled loop
is executed at least once if the conditions is false
the unconditional loop
Value of elements in array
First element of the array
Base address of the array
Address of the last element of array
volatile
true
friend
export
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
Martin Richards
Dennis Ritchie
Ken Thompson
Herman Hellorith
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
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
-3.4e38 to 3.4e38
-32767 to 32768
-32668 to 32667
-32768 to 32767
print("Hello World");
echo("Hello World");
printf("Hello World");
None of these
4 Bytes
8 Bytes
Depends on the system/compiler
Cannot be determined
world
addition23
test-name
factorial
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.
immutable
mutable
const
Spaces
Digits
Underscores
Letters
int a = 5;printf("%d", a == 5);
5
Undefined
* / % + - =
= * / % + -
/ * % - + =
* % / - + =
print()
input()
All of the above
power of y to the x
power of x to the y
logarithm of x on the base y
Such function does not exist
4
Depends on the system
for loop
while loop
do-while loop
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
main function arguments
main arguments
Command-Line arguments
Parameterized arguments
1return
return1
$return_1
results in a syntax error
output Infomax7
outputs garbage
outputs infomax and terminates abruptly
What is the output of this statement
printf("%d", (a++));
The value of (a + 1)
Error message
Garbage
The current value of a
-5
+5
Constants
Keywords
Operators
Tokens
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.
Algorithm
Flow-Charts
Procedural
Object Oriented
for (int i = 0; i < 10; i++)
for i = 0 to 10 step 1
for (i = 0; i < 10; i++)
for (i < 10; i++)
final
constant
static
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
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
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);}
Error because of incorrect line-1 only.
Error because of incorrect line-1 and line-2.
Error because of incorrect line-2 only.
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
A number
A special symbol other than underscore
Both of the above
An alphabet
int x = 5;printf("%d", ++x);
6
7