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.

When does the code block following while(x<100) execute?

A.    When x is less than one hundred Wrong Right

B.    When x is greater than one hundred Wrong Right

C.    When x is equal to one hundred Wrong Right

D.    While it wishes Wrong Right

Answer : When x is less than one hundred

Explanation : There is no explanation...

Learn more problems on : Loops

Discuss on this question

2.

Use a scanf statement to read a string of characters into the array words.

A.    scanf("%s\n", words); Wrong Right

B.    scanf(" %c", words); Wrong Right

C.    scanf("%c", words); Wrong Right

D.    scanf("%s", words); Wrong Right

Answer : scanf("%s", words);

Explanation : There is no explanation...

Learn more problems on : Arrays

Discuss on this question

3.

Which is a valid typecast?

A.    a(char); Wrong Right

B.    char:a; Wrong Right

C.    (char)a; Wrong Right

D.    to(char, a); Wrong Right

Answer : (char)a;

Explanation : There is no explanation...

Learn more problems on : Typecasting

Discuss on this question

4.

What is the output of following C code?
main()
{
static int var = 5;
printf("%d ",var--);
if(var)
main();
}

A.    5 4 3 2 1 Wrong Right

B.    4 3 2 1 Wrong Right

C.    3 2 1 Wrong Right

D.    5 4 3 2 Wrong Right

E.    5 4 3 2 1 0 Wrong Right

Answer : 5 4 3 2 1

Explanation : When static storage class is given, it is initialized once. The change in the value of a static variable is retained even between the function calls. Main is also treated like any other ordinary function, which can be called recursively.

Learn more problems on : If statements

Discuss on this question

5.

What is the output of this program?
main()
{
struct xx
{
int x=3;
char name[]="hello";
};
struct xx *s;
printf("%d",s->x);
printf("%s",s->name);
}

A.    3 Wrong Right

B.    Compile Error Wrong Right

C.    hello Wrong Right

D.    null Wrong Right

Answer : Compile Error

Explanation : You should not initialize structure variables in declaration.

Learn more problems on : Structures

Discuss on this question

6.

The statement which prints out the text string "Welcome", followed by a newline, is.

A.    printf("Welcome\n"); Wrong Right

B.    printf("Welcome\n"); Wrong Right

C.    printf(Welcome\n); Wrong Right

D.    printf('Welcome', '\n'); Wrong Right

Answer : printf("Welcome\n");

Explanation : There is no explanation...

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

Discuss on this question

7.

Which one is the correct order of evaluation for the below expression? z = x + y * z / 4 % 2 – 1

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.

If the above structure of type date comprises three integer fields, day, month, year, assign the value 10 to the field day using the dates pointer.

A.    dates.day = 10; Wrong Right

B.    dates->day = 10; Wrong Right

C.    dates = 10.day; Wrong Right

D.    day.dates = 10; Wrong Right

Answer : dates->day = 10;

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 clrscr() 100
main()
{
clrscr();
printf("%d\n",clrscr());
}

A.    100 Wrong Right

B.    200 Wrong Right

C.    Compiler Error Wrong Right

D.    null Wrong Right

Answer : 100

Explanation : Preprocessor executes as a separate pass before the execution of the compiler. So textual replacement of clrscr() to 100 occurs. The input program to compiler looks like this :
main()
{
100;
printf("%d\n",100);
}
Note:
100; is an executable statement but with no action. So it doesn't give any problem

Learn more problems on : Preprocessor Directives

Discuss on this question

10.

What will be the output of the following program?
main()
{
int i=1,j=2;
switch(i)
{
case 1: printf("GOOD");
break;
case j: printf("BAD");
break;
}
}

A.    GOOD Wrong Right

B.    BAD Wrong Right

C.    Compiler Error Wrong Right

D.    No Output Wrong Right

Answer : Compiler Error

Explanation :

Compiler Error: Constant expression required in function main.
The case statement can have only constant expressions .Enumerated types can be used in case statements.

Learn more problems on : Switch-case

Discuss on this question

11.

What does the "auto" specifier do?

A.    It automatically initializes a variable to 0;. Wrong Right

B.    It indicates that a variable's memory will automatically be preserved. Wrong Right

C.    It automatically increments the variable when used. Wrong Right

D.    It automatically initializes a variable to NULL. Wrong Right

E.    It indicates that a variable's memory space is allocated upon entry into the block. Wrong Right

Answer : It indicates that a variable's memory will automatically be preserved.

Explanation : There is no explanation...

Learn more problems on : Defining Variables

Discuss on this question

12.

What will the output of following C code?
main()
{
int i=5,j=6,z;
printf("%d",i+++j);
}

A.    11 Wrong Right

B.    12 Wrong Right

C.    10 Wrong Right

D.    error Wrong Right

Answer : 11

Explanation : the expression i+++j is treated as (i++ + j)

Learn more problems on : Operators

Discuss on this question

13.

How would you round off a value from 1.66 to 2.0?

A.    ceil(1.66) Wrong Right

B.    floor(1.66) Wrong Right

C.    roundup(1.66) Wrong Right

D.    roundto(1.66) Wrong Right

Answer : ceil(1.66)

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()
{
int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} };
int *p,*q;
p=&a[2][2][2];
*q=***a;
printf("%d----%d",*p,*q);
}

A.    SomeGarbageValue---1 Wrong Right

B.    0 Wrong Right

C.    Compiler Error Wrong Right

D.    2..6 Wrong Right

Answer : SomeGarbageValue---1

Explanation : p=&a[2][2][2] you declare only two 2D arrays, but you are trying to access the third 2D(which you are not declared) it will print garbage values. *q=***a starting address of a is assigned integer pointer. Now q is pointing to starting address of a. If you print *q, it will 

Learn more problems on : Pointers

Discuss on this question

15.

What is the output of the following code?
#include "stdio.h"
extern int a;
main(){
void fun();
printf("\n a= %d",a);
fun();
return 0;
}
int a;
void fun(){
printf("\n in fun a=%d",a);
}

A.    a=5 in fun a=0 Wrong Right

B.    a=0 in fun a=5 Wrong Right

C.    a=5 in fun a=5 Wrong Right

D.    a=0 in fun a=0 Wrong Right

Answer : a=5 in fun a=5

Explanation : There is no explanation...

Learn more problems on : Functions

Discuss on this question

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