ceil(1.66)
floor(1.66)
roundup(1.66)
roundto(1.66)
What will be the output of the following code?
int x = 5;printf("%d", ++x);
4
5
6
7
2.5
2
2.000000
2.500000
Undefined
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
Moves the file pointer to a specific location
Reads a file
Writes to a file
Closes a file
What will the following code print?
int x = 5;if (x = 0)printf("Zero");elseprintf("Not zero");
Zero
Not zero
Compilation error
Error
1
3
"r"
"w"
"rw"
"read"
for (int i = 0; i < 10; i++)
for i = 0 to 10 step 1
for (i = 0; i < 10; i++)
for (i < 10; i++)
Logical Operator
Conditional Operator
typecast
Ternary
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.
//
/
#
/*
-1
0
30
32
36
40
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
System programming language
General purpose language
Data processing language
None of the above
break
continue
return
exit
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
char str[] = "Hello";
char str = "Hello";
string str = "Hello";
char str[] = {'H', 'e', 'l', 'l', 'o'};
Consider the following code and How many bytes of memory will be allocated?
int *ptr = (int *)malloc(10 * sizeof(int));
10 bytes
20 bytes
80 bytes
40 bytes
start()
printf()
main()
getch()
auto
case
main
default
*
+
++
&&
switch
goto
go back
function(int ptr);
function(int *ptr);
function(*ptr);
function(ptr *int);
A
B
ADA
C++
main function arguments
main arguments
Command-Line arguments
Parameterized arguments
ctype.h
stdio.h
conio.h
math.h
Value of elements in array
First element of the array
Base address of the array
Address of the last element of array
<
=
>=
<=
int
float
include
char
Algorithm
Flow-Charts
Procedural
Object Oriented
&
||
!
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
Martin Richards
Dennis Ritchie
Ken Thompson
Herman Hellorith
Depends on array size
scanf()
getche()
gets()
for loop
while loop
do-while loop
none of the above
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
What is the final value of x when the code is executed?
int x; for(x=0; x<10; x++) {}
10
9
What is the output of the following code?
int a = 10, b = 5;printf("%d", a / b);
0.5
15
link, load, code, compile and execute
code, compile, link, execute and load
code, compile, link, load and execute
compile, code, link, load and execute
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
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.
C compiler supports octal integer constant.
C compiler supports hexadecimal integer constant.
C compiler supports binary integer constant.
C compiler supports decimal integer constant.
8
Either True or False
is less than or is more than
is equal or less or more
All of the above
printf("\n");
echo '\n';
printf('\n');
printf('\\n')
int number;
float rate;
int variable_count;
int $main;