C PROGRAM QUESTIONS : PART 1
The first expression in a for loop is
Step value of loop
Value of the counter variable
Any of above
None of above
Value of the counter variable
SHOW ANSWER
Break statement is used for
Quit a program
Quit the current iteration
Both of above
None of above
Quit the current iteration
SHOW ANSWER
Continue statement used for
To continue to the next line of code
To stop the current iteration and begin the next iteration from the beginning
To handle run time error
None of above
To stop the current iteration and begin the next iteration from the beginning
SHOW ANSWER
What will be output of
#include
void main()
{
char test =`S`;
printf("\n%c",test);
}
S
Error
Garbage value
None of above
SHOW ANSWER
Due to variable scope in c
Variables created in a function cannot be used another function
Variables created in a function can be used in another function
Variables created in a function can only be used in the main function
None of above
Variables created in a function cannot be used another function
SHOW ANSWER
What will be the output of following program
#include
main()
{
int x,y = 10;
x = y * NULL;
printf(\"%d\",x);
}
error
0
10
Garbage value
SHOW ANSWER
Difference between calloc() and malloc()
calloc() takes a single argument while malloc() needs two arguments
malloc() takes a single argument while calloc() needs two arguments
malloc() initializes the allocated memory to ZERO
calloc() initializes the allocated memory to NULL
malloc() takes a single argument while calloc() needs two arguments
SHOW ANSWER
Exit() is same as return
TRUE
FALSE
SHOW ANSWER
calloc() belongs to which library
malloc.h
calloc.h
None of above
SHOW ANSWER
If include files can be nested
Yes
No
SHOW ANSWER
Which of the following below is/are valid C keywords
integer
int
null
none of above
SHOW ANSWER
total number of keywords in C are
30
32
48
132
SHOW ANSWER
What is use of \r in c
used to insert a vertical tab
used to insert a tab
places cursor at the end of line
places cursor at the start of line
places cursor at the start of line
SHOW ANSWER