AT & Ts Bell Laboratories of USA in 1972
AT & Ts Bell Laboratories of USA in 1970
Sun Microsystems in 1973
Cambridge University in 1972
function(int ptr);
function(int *ptr);
function(*ptr);
function(ptr *int);
char > int > float
int > char > float
char < int < double
double > char > int
What is the final value of x when the code is executed?
int x; for(x=0; x<10; x++) {}
10
9
0
1
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.
Id_No
ID_NO
IdNo
Id No
Logical Operator
Conditional Operator
typecast
Ternary
Algorithm
Flow-Charts
Procedural
Object Oriented
To determine which operator evaluated first from left to right.
To determine the level of an operator in a program.
To determine how an expression involving more than one operator is evaluated.
To check the expression is valid or not.
ceil(1.66)
floor(1.66)
roundup(1.66)
roundto(1.66)
getchar()
gets()
scanf()
cin.get()
It breaks out of both loops.
It only breaks out of the innermost loop.
It causes a compile-time error.
It stops the program.
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
Input data
The program does not require any function.
Output data
The program must have at least one function.
for loop
while loop
do-while loop
None of the above
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
main function arguments
main arguments
Command-Line arguments
Parameterized arguments
What is the output of the following code?
int a = 5;printf("%d", a == 5);
5
Undefined
int num;
integer num;
num int;
num integer;
-4
-2.8
+2.8
+3
link, load, code, compile and execute
code, compile, link, execute and load
code, compile, link, load and execute
compile, code, link, load and execute
C compiler supports octal integer constant.
C compiler supports hexadecimal integer constant.
C compiler supports binary integer constant.
C compiler supports decimal integer constant.
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
Return
GOTO
Switch
exit
4
6
for (i=1; i < 20; i++) printf ("k");
for (i=1; i = 20; i++) printf ("k");
for (i=0; i < 20; i++) printf ("k");
for (i=0; i <= 20; i++) printf ("k");
conio.h
string.h
math.h
graphic.h
&
&&
||
!
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
int my_num = 100,000;
int my_num = 100000;
int my num = 1000;
int $my_num = 10000;
for (int i = 0; i < 10; i++)
for i = 0 to 10 step 1
for (i = 0; i < 10; i++)
for (i < 10; i++)
infomax
info_max
info max
All of these
int arr[5] = {1, 2, 3, 4, 5};printf("%d", arr[3]);
2
3
Moves the file pointer to a specific location
Reads a file
Writes to a file
Closes a file
no of students
char
7th
myName
strlen()
sizeof()
length()
strlength()
2.5
2.000000
2.500000
break
continue
return
20
None
Binary operator
Unary operator
Ternary operator
All of the above
An array of characters
The object of some class
Same as other primitive data type
Linkedlist of characters
N=m=0
Value+=10
mySize=x<y?9:11
Value=+=10
-3.4e38 to 3.4e38
-32767 to 32768
-32668 to 32667
-32768 to 32767
switch
goto
go back
volatile
true
friend
export
An Editor
A compiler
An operating system
None of these
do-while
if-else
for
while
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
static
new