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
float, double
short int, double, long int
float, double, long double
double, long int, float
Value of elements in array
First element of the array
Base address of the array
Address of the last element of array
no of students
char
7th
myName
Using malloc() without free()
Using calloc() without realloc()
Using pointers incorrectly
None of the above
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
What is the output of the following code?
int a = 5, b = 10;if (a < b)printf("a is less than b");elseprintf("a is greater than or equal to b");
a is greater than or equal to b
a is less than b
Compiler Error
Undefined
"r"
"w"
"rw"
"read"
char > int > float
int > char > float
char < int < double
double > char > int
<
=
>=
<=
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.
printf("\n");
echo '\n';
printf('\n');
printf('\\n')
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
print()
scanf()
input()
All of the above
switch
goto
go back
return
main function arguments
main arguments
Command-Line arguments
Parameterized arguments
fclose()
closefile()
fileclose()
endfile()
signed short
unsigned short
long
int
strlen()
sizeof()
length()
strlength()
void
endl
float
1
2
4
8
10
20
0
None
What will be the output of following program?
int main() { for(int c=1;c<5;++c); printf(“%d”,c); }
5
6
12345
“programming Trick”
“programming"
‘programming'
$ 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
1return
return1
$return_1
Infinitely
Variable
&&
| |
!
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 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
exit
break
continue
What will be the output of the following code?
int a = 10, b = 20;printf("%d", a + b);
30
1020
10+20
Compiler error
System programming language
General purpose language
Data processing language
for loop
while loop
do-while loop
immutable
mutable
const
volatile
What is the final value of x when the code is executed?
int x; for(x=0; x<10; x++) {}
9
link, load, code, compile and execute
code, compile, link, execute and load
code, compile, link, load and execute
compile, code, link, load and execute
16
auto
case
main
default
-5
+5
N=m=0
Value+=10
mySize=x<y?9:11
Value=+=10
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
int arr[10][10];
int arr[10,10];
array int arr[10][10];
int arr{10}{10};
compare two numeric values
combine two numeric values
compare two boolean values
3
Binary operator
Unary operator
Ternary operator
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
int x = 5;printf("%d", ++x);
7
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
none of the above