Guest | Sign in | Register

Sign in to LucentBlackBoard

E-mail Id
Password
Loading...

New Member to LucentBlackBoard?

Forgot Your Password?

Enter your registered e-mail address, your password will be sent to e-mail address.
Enter E-mail Id
Loading...

Time left :





Note:

1. Total number of questions : 15.

2. Time alloted : 20 minutes.

3. Each question carry 1 mark, no negative marks.

4. Click the 'Submit Test' button given in the bottom of this page to Submit your answers.

5. Test will be submitted automatically if the time expired.

6. Don't refresh the page.

Result and Statistics

Time Left :

Result and Statistics ( Test No : online_test_number )

A. Number Of Question

15

B. Number Of Attempted

-

C. Number Of Correct Answer

-

D. Number Of Wrong Answer ( D = B-C )

-

E. Total Score ( E = C )

-

F. Accuracy Rate ( F = C / B * 100 )

-

G. Total Percentage ( G = C / A * 100 )

-



1.

How many times is a do while loop guaranteed to loop?

A.    0 Wrong Right

B.    Infinitely Wrong Right

C.    1 Wrong Right

D.    Variable Wrong Right

Answer : 1

Explanation : There is no explanation...

Learn more problems on : Loops

Discuss on this question

2.

What will be printed as the result of the operation below?
main()
{
char s1[]="Cisco"
char s2[]= "systems";
printf("%s",s1);
}

A.    system Wrong Right

B.    error Wrong Right

C.    Cisco Wrong Right

D.    Compilation fail Wrong Right

Answer : Cisco

Explanation : There is no explanation...

Learn more problems on : Arrays

Discuss on this question

3.

Which is a good use for typecasting?

A.    To allow division of two integers to return a decimal value. Wrong Right

B.    To allow your program to use nothing but integers. Wrong Right

C.    To change the return type of a function. Wrong Right

D.    To swap variables rapidly. Wrong Right

Answer : To allow division of two integers to return a decimal value.

Explanation : There is no explanation...

Learn more problems on : Typecasting

Discuss on this question

4.

The statement that compares the value of an integer called sum against the value 65, and if it is less, prints the text string "Sorry, try again", is

printf("Sorry, try again" );
"/> A.    Statement 1
if( sum < "65" )
printf("Sorry, try again" );
Wrong Right

"/> B.    Statement 2
if( sum <= 65 )
printf("Sorry, try again" );
Wrong Right

"/> C.    Statement 3
if( 65 == sum )
printf("Sorry, try again" );
Wrong Right

"/> D.    Statement 4
if( sum < 65 )
printf("Sorry, try again" );
Wrong Right

Answer : Statement 4
if( sum < 65 )
printf("Sorry, try again" );

Explanation : There is no explanation...

Learn more problems on : If statements

Discuss on this question

5.

 What is the output of this program?
struct aaa{
struct aaa *prev;
int i;
struct aaa *next;
};
main()
{
struct aaa abc,def,ghi,jkl;
int x=100;
abc.i=0;abc.prev=&jkl;
abc.next=&def;
def.i=1;def.prev=&abc;def.next=&ghi;
ghi.i=2;ghi.prev=&def;
ghi.next=&jkl;
jkl.i=3;jkl.prev=&ghi;jkl.next=&abc;
x=abc.next->next->prev->next->i;
printf("%d",x);
}

A.    3 Wrong Right

B.    100 Wrong Right

C.    2 Wrong Right

D.    0 Wrong Right

Answer : 2

Explanation : above all statements form a double circular linked list;
abc.next->next->prev->next->i
this one points to "ghi" node the value of at particular node is 2.

Learn more problems on : Structures

Discuss on this question

6.

The statement which prints out the value of the float variable discount, is

A.    printf("%s", discount); Wrong Right

B.    printf("%s", discount); Wrong Right

C.    printf("%f", discount); Wrong Right

D.    printf("%d", discount); Wrong Right

Answer : printf("%f", discount);

Explanation : There is no explanation...

Learn more problems on : printf() and scanf()

Discuss on this question

7.

What punctuation ends most lines of C code?

A.    . Wrong Right

B.    ; Wrong Right

C.    : Wrong Right

D.    ' Wrong Right

Answer : ;

Explanation : There is no explanation...

Learn more problems on : C Basics

Discuss on this question

8.

A pointer called mpu641 of type machine is declared. What is the command to assign the value NULL to the field memory.

A.    mpu641->memory = (char *) NULL; Wrong Right

B.    mpu641.memory = 0; Wrong Right

C.    mpu641-memory = 0; Wrong Right

D.    strcpy( mpu641.memory, NULL); Wrong Right

Answer : mpu641->memory = (char *) NULL;

Explanation : There is no explanation...

Learn more problems on : Pointers & Structures

Discuss on this question

9.

What is the output of following C code?

#define FALSE -1
#define TRUE 1
#define NULL 0
main() {
if(NULL)
puts("NULL");
else if(FALSE)
puts("TRUE");
else
puts("FALSE");
}

A.    Error Wrong Right

B.    NULL Wrong Right

C.    FALSE Wrong Right

D.    TRUE Wrong Right

Answer : TRUE

Explanation : Preprocessor doesn't replace the values given inside the double quotes. The check by if condition is boolean value false so it goes to else. In second if -1 is Boolean value true hence "TRUE" is printed.

Learn more problems on : Preprocessor Directives

Discuss on this question

10.

What is required to avoid falling through from one case to the next?

A.    end Wrong Right

B.    break Wrong Right

C.    Stop Wrong Right

D.    A semicolon. Wrong Right

Answer : break

Explanation : There is no explanation...

Learn more problems on : Switch-case

Discuss on this question

11.

Write C statements which tests to see if input_file has opened the data file successfully. If not, print an error message and exit the program.

exit(1);
}
"/> A.    Test 1
if( input_file == NULL ) {
printf("Unable to open file.\n");\
exit(1);
}
Wrong Right

exit(1);
}
"/> B.    Test 2
if( input_file != NULL ) {
printf("Unable to open file.\n");\
exit(1);
}
Wrong Right

exit(1);
}
"/> C.    Test 3
while( input_file = NULL ) {
printf("Unable to open file.\n");\
exit(1);
}
Wrong Right

D.    Cannot be determined Wrong Right

Answer : Test 1
if( input_file == NULL ) {
printf("Unable to open file.\n");\
exit(1);
}

Explanation : There is no explanation...

Learn more problems on : File Handling

Discuss on this question

12.

What will the output of following C code?
main()
{
int i =0;j=0;
if(i && j++)
printf("%d..%d",i++,j);
printf("%d..%d,i,j);
}

A.    1..1 Wrong Right

B.    1..0 Wrong Right

C.    0..1 Wrong Right

D.    0..0 Wrong Right

Answer : 0..0

Explanation : The value of i is 0. Since this information is enough to determine the truth value of the boolean expression. So the statement following the if statement is not executed. The values of i and j remain unchanged and get printed.

Learn more problems on : Operators

Discuss on this question

13.

With what do you replace the ???? to make the function shown below return the correct answer?
long factorial (long x)
{
????
return x * factorial(x - 1);
}

A.    if (x == 0) return 0; Wrong Right

B.    return 1; Wrong Right

C.    if (x >= 2) return 2; Wrong Right

D.    if (x <= 1) return 1; Wrong Right

Answer : if (x <= 1) return 1;

Explanation : There is no explanation...

Learn more problems on : Inbuilt Functions

Discuss on this question

14.

Predict the output or error(s) for the following?


main()
{
char s[]={'a','b','c','\n','c','\0'};
char *p,*str,*str1;
p=&s[3];
str=p;
str1=s;
printf("%d",++*p + ++*str1-32);
}

A.    Garbage Value Wrong Right

B.    0 Wrong Right

C.    M Wrong Right

D.    None of these Wrong Right

Answer : M

Explanation : p is pointing to character '\n'.str1 is pointing to character 'a' ++*p meAnswer:"p is pointing to '\n' and that is incremented by one." the ASCII value of '\n' is 10. then it is incremented to 11. the value of ++*p is 11. ++*str1 meAnswer:"str1 is pointing to 'a' that is incremented by 1 and it becomes 'b'. ASCII value of 'b' is 98. both 11 and 98 is added and result is subtracted from 32.
i.e. (11+98-32)=77("M");

Learn more problems on : Pointers

Discuss on this question

15.

What will be the output


main()
{
char *ptr = "Pskills.org";
char a =
printf("%c", ++*ptr++);
}

A.    Compilation Error Wrong Right

B.    Q Wrong Right

C.    P Wrong Right

D.    a Wrong Right

Answer : Q

Explanation : ++*ptr++ will retrieve the value currently pointed by ptr i.e P and then increment the value and will print Q.

Learn more problems on : Pointers

Discuss on this question

Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.