1. What is the following code segment doing?
void fn( )
if (c != ‘\n’)
The string entered is printed as it is.
The string entered is printed in reverse order.
It will go in an infinite loop.
It will print an empty line.
You must be logged in to post a comment.
2. For loop in a C program, if the condition is missing
it is assumed to be present and taken to be false
it is assumed to be present and taken to the true
it result in a syntax error
execution will be terminated abruptly
3. Which of the following statement about for loop is true?
Index value is retained outside the loop
Index value can be changed from within the loop
Goto can be used to jump, out of the loop
All of these
4. If c is a variable initialised to 1, how many times will the following loop be executed?
while ((c > 0) && (c < 60))
None of these
5. How many times will the following loop be executed if the input data item is 0 1 2 3 4?
while (c = getchar ()! = 0)
UGC NET PAPER 1
UGC NET Management
UGC NET COMPUTER SCIENCE
UGC NET COMMERCE
GATE COMPUTER SCIENCE
CFA Level 1
Login with Facebook
Login with Google
Forgot your password?
Lost your password? Please enter your email address. You will receive mail with link to set new password.
Back to login