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.

Consider the following program,
main ()
{
int i, j;
for (i=0, j=5; j >0, i < 10; i ++, j--)
printf("lucentblackboard.com");
}
How many times " lucentblackboard.com " will get printed

A.    5 Wrong Right

B.    Compilation Error Wrong Right

C.    10 Wrong Right

D.    Compilation Error Wrong Right

Answer : 10

Explanation : Condition part of for loop ( j>0, i<10 ) is separated by commas which means that compiler will use the value which is at right hand side of comma i.e of i<10 so the loop will execute till the value of i is less than 10.

Learn more problems on : Loops

Discuss on this question

2.

What will be output if you will execute following c code?
#include
int main(){
char arr[7]="Network";
printf("%s",arr);
return 0;
}  

A.    Network Wrong Right

B.    N Wrong Right

C.    network Wrong Right

D.    Garbage value Wrong Right

E.    Compilation error Wrong Right

Answer : Garbage value

Explanation : There is no explanation...

Learn more problems on : Arrays

Discuss on this question

3.

In what order do the two command line variables appear in the definition of main?

A.    Count then argument array Wrong Right

B.    Argument array then count Wrong Right

C.    They don't appear in the definition of main Wrong Right

D.    There is only one argument. Wrong Right

Answer : Count then argument array

Explanation : There is no explanation...

Learn more problems on : Command Line Arguments

Discuss on this question

4.

The statement that tests to see if sum is equal to 10 and total is less than 20, and if so, prints the text string "incorrect.", is

"/> A.    Statement 1
if( (sum = 10) && (total < 20) )
printf("incorrect.");
Wrong Right

"/> B.    Statement 2
if( (sum == 10) && (total < 20) )
printf("incorrect.");
Wrong Right

"/> C.    Statement 3
if( (sum == 10) || (total < 20) )
printf("incorrect.");
Wrong Right

D.    Cannot be determined Wrong Right

Answer : Statement 2
if( (sum == 10) && (total < 20) )
printf("incorrect.");

Explanation : There is no explanation...

Learn more problems on : If statements

Discuss on this question

5.

The statment that assigns the value 10 to the field loop of the sample structure (which is of type struct record), is

A.    loop =10 Wrong Right

B.    sample.loop=10 Wrong Right

C.    record.sample.loop=10 Wrong Right

D.    record.loop=10 Wrong Right

Answer : sample.loop=10

Explanation : There is no explanation...

Learn more problems on : Structures

Discuss on this question

6.

The statement which correctly assigns the value of the variable number1 to the variable total, is

A.    total := number1; Wrong Right

B.    number1 = total; Wrong Right

C.    total = number1; Wrong Right

D.    number1 := total; Wrong Right

Answer : total = number1;

Explanation : There is no explanation...

Learn more problems on : Assignments

Discuss on this question

7.

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

A.    a=0 Wrong Right

B.    a=garbage value Wrong Right

C.    error Wrong Right

D.    none of these Wrong Right

Answer : a=0

Explanation : There is no explanation...

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

Discuss on this question

8.

The statement that correctly defines a character called letter is

A.    letter := char; Wrong Right

B.    char letter; Wrong Right

C.    letter : char; Wrong Right

D.    character letter; Wrong Right

Answer : char letter;

Explanation : There is no explanation...

Learn more problems on : Defining Variables

Discuss on this question

9.

What is the output of following program?


void main(){
int a=2;
switch(a);
{
case 1: printf("A");
case 2: printf("B");
case 3: printf("C");
break;
case 4: printf("D");
default : printf("E");
break;
}
}

A.    B C Wrong Right

B.    B D Wrong Right

C.    B E Wrong Right

D.    error Wrong Right

Answer : B E

Explanation : There is no explanation...

Learn more problems on : Switch-case

Discuss on this question

10.

Which one of the following is valid for opening a read-only ASCII file?

A.    fileOpen (filenm, "r"); Wrong Right

B.    fileOpen (filenm, "ra"); Wrong Right

C.    fileOpen (filenm, "read"); Wrong Right

D.    fopen (filenm, "read"); Wrong Right

E.    fopen (filenm, "r"); Wrong Right

Answer : fopen (filenm, "r");

Explanation : There is no explanation...

Learn more problems on : File Handling

Discuss on this question

11.

What will be printed as the result of the operation below?
main()
{
int x=5;
printf("%d,%d,%d",x,x<<2,x>>2);
}

A.    5,21,1 Wrong Right

B.    5,20,1 Wrong Right

C.    5,19,0 Wrong Right

D.    5,19,1 Wrong Right

Answer : 5,20,1

Explanation : There is no explanation...

Learn more problems on : Operators

Discuss on this question

12.

What is the output of following program?
void main(){
printf("%d%d",sizeof(10),sizeof(5,5));
}

A.    2 2 Wrong Right

B.    2 4 Wrong Right

C.    2 6 Wrong Right

D.    2 8 Wrong Right

Answer : 2 8

Explanation : There is no explanation...

Learn more problems on : Inbuilt Functions

Discuss on this question

13.

What is the return type of the function with prototype: "int func(char x, float v, double t);"

A.    char Wrong Right

B.    int Wrong Right

C.    float Wrong Right

D.    double Wrong Right

Answer : int

Explanation : There is no explanation...

Learn more problems on : Functions

Discuss on this question

14.

Which of the following gives the memory address of a variable pointed to by pointer a?

A.    a; Wrong Right

B.    *a; Wrong Right

C.    &a; Wrong Right

D.    address(a); Wrong Right

Answer : a;

Explanation : There is no explanation...

Learn more problems on : Pointers

Discuss on this question

15.

What will be output of following program?


#include
int main()
{
int a = 320;
char *ptr;
ptr = (char *)&a;
printf("%d",*ptr);
return 0;
}

A.    2 Wrong Right

B.    320 Wrong Right

C.    64 Wrong Right

D.    Compilation Error Wrong Right

Answer : 64

Explanation : As we know int is two byte data byte while char is one byte data byte. Character pointer can keep the address one byte at time.

Binary value of 320 is 00000001 01000000 (In 16 bit) Memory representation of int a = 320 is:

So ptr is pointing only first 8 bit which color is green and Decimal value is 64. 

Learn more problems on : Pointers

Discuss on this question

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