What is the output of the following code?
int a = 10, b = 5;printf("%d", a / b);
5
2
0.5
15
Assignment Relational Arithmetic
Arithmetic Relational Assignment
Relational Arithmetic Assignment
Assignment Arithmetic Relational
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
main function arguments
main arguments
Command-Line arguments
Parameterized arguments
2 bytes
4 bytes
8 bytes
1 byte
It returns the size of the variable in bits
It returns the size of the variable in bytes
It returns the size of the variable in kilobytes
It returns the number of elements in an array
float
double
long double
far double
What will be the output of following program?
int main() { for(int c=1;c<5;++c); printf(“%d”,c); }
1
6
12345
char > int > float
int > char > float
char < int < double
double > char > int
real
int
Value of elements in array
First element of the array
Base address of the array
Address of the last element of array
for (int i = 0; i < 10; i++)
for i = 0 to 10 step 1
for (i = 0; i < 10; i++)
for (i < 10; i++)
ctype.h
stdio.h
conio.h
math.h
Addition, Division, Modulus
Addition, Modulus, Division
Multiplication, Substration, Modulus
Modulus, Multiplication, Substration
fclose()
closefile()
fileclose()
endfile()
4
8
do-while
if-else
for
while
3
break
continue
return
None of these
Undefined
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
Depends on the system
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
int a = 5;printf("%d", a == 5);
0
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
A
B
ADA
C++
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
int a(char *s)
void b(int a[], int n)
float *c()
short d(long x)
System programming language
General purpose language
Data processing language
None of the above
exit
int number;
float rate;
int variable_count;
int $main;
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.
ceil(1.66)
floor(1.66)
roundup(1.66)
roundto(1.66)
What is the final value of x when the code is executed?
int x; for(x=0; x<10; x++) {}
10
9
"r"
"w"
"rw"
"read"
Infinitely
Variable
Compilation error
Program will terminate with an error
Undefined behavior
Array index will wrap around
_infomax
3infomax
infomax_ica
infomax123
Constants
Keywords
Operators
Tokens
stdlib.h
for loop
while loop
do-while loop
Id_No
ID_NO
IdNo
Id No
-5
+5
<
=
>=
<=
no of students
char
7th
myName
What will be the output of the following code?
int x = 5;printf("%d", ++x);
7
*
+
++
&&
char str[] = "Hello";
char str = "Hello";
string str = "Hello";
char str[] = {'H', 'e', 'l', 'l', 'o'};
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
compare two numeric values
combine two numeric values
compare two boolean values