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.

The statement which prints out the values 1 to 10 on separate lines, is

"/> A.     Statement 1
for( count = 1; count <= 10; count = count + 1)
printf("%d\n", count);
Wrong Right

"/> B.    Statement 2
for( count = 1; count < 10; count = count + 1)
printf("%d\n", count);
Wrong Right

"/> C.     Statement 3
for( count = 0; count <= 9; count = count + 1)
printf("%d ", count);
Wrong Right

"/> D.    Statement 4
for( count = 1; count <> 10; count = count + 1)
printf("%d\n", count);
Wrong Right

Answer :  Statement 1
for( count = 1; count <= 10; count = count + 1)
printf("%d\n", count);

Explanation : There is no explanation...

Learn more problems on : Loops

Discuss on this question

2.

Which of the following correctly accesses the seventh element stored in foo, an array with 100 elements?

A.    foo[6]; Wrong Right

B.    foo[7]; Wrong Right

C.    foo(7); Wrong Right

D.    foo; Wrong Right

Answer : foo[6];

Explanation : There is no explanation...

Learn more problems on : Arrays

Discuss on this question

3.

Which conversion is not possible?

A.    int to float Wrong Right

B.    float to int Wrong Right

C.    char to float Wrong Right

D.    All are possible Wrong Right

Answer : All are possible

Explanation : There is no explanation...

Learn more problems on : Typecasting

Discuss on this question

4.

The statement that compares total for equality to good_guess, and if equal prints the value of total, and if not equal prints the value of good_guess, is

else
printf("%d", good_guess );
"/> A.    Statement 1
if( total < good_guess )
printf("%d", total );
else
printf("%d", good_guess );
Wrong Right

else
printf("%d", total );
"/> B.    Statement 2
if( total == good_guess )
printf("%d", good_guess );
else
printf("%d", total );
Wrong Right

else
printf("%d", good_guess );
"/> C.    Statement 3
if( total = good_guess )
printf("%d", total );
else
printf("%d", good_guess );
Wrong Right

else
printf("%d", good_guess );
"/> D.    Statement 4
if( total == good_guess )
printf("%d", total );
else
printf("%d", good_guess );
Wrong Right

Answer : Statement 4
if( total == good_guess )
printf("%d", total );
else
printf("%d", good_guess );

Explanation : There is no explanation...

Learn more problems on : If statements

Discuss on this question

5.

What is the output of this program?
struct point
{
int x;
int y;
};
struct point origin,*pp;
main()
{
pp=&origin;
printf("origin is(%d%d)\n",(*pp).x,(*pp).y);
printf("origin is (%d%d)\n",pp->x,pp->y);
}

A.    origin is(0,0) origin is(0,1) Wrong Right

B.    origin is(1,1) origin is(0,0) Wrong Right

C.    origin is(0,0) origin is(0,0) Wrong Right

D.    None of these Wrong Right

Answer : origin is(0,0) origin is(0,0)

Explanation : pp is a pointer to structure. we can access the elements of the structure either with arrow mark or with indirection operator.
Note:
Since structure pointer is globally declared x & y are initialized as zeroes

Learn more problems on : Structures

Discuss on this question

6.

The statement which prints out the value of the float variable dump using two decimal places, is

A.    printf("%f", dump); Wrong Right

B.    printf("%.2f", dump); Wrong Right

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

D.    printf("%f", &dump); Wrong Right

Answer : printf("%.2f", dump);

Explanation : There is no explanation...

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

Discuss on this question

7.

Which of the following is a correct comment?

A.    */ Comments */ Wrong Right

B.    ** Comment ** Wrong Right

C.    /* Comment */ Wrong Right

D.    { Comment } Wrong Right

Answer : /* Comment */

Explanation : There is no explanation...

Learn more problems on : C Basics

Discuss on this question

8.

Assign the address of the character array CPUtype to the field memory using the pointer mpu641.

A.    mpu641.memory = &CPUtype; Wrong Right

B.    mpu641->memory = CPUtype; Wrong Right

C.    strcpy( mpu641.memory, CPUtype); Wrong Right

D.    mpu641.memory = CPUtype; Wrong Right

Answer : mpu641->memory = CPUtype;

Explanation : There is no explanation...

Learn more problems on : Pointers & Structures

Discuss on this question

9.

What is the output of following C code?
#if something == 0
int some=0;
#endif

main()
{
int thing = 0;
printf("%d %d\n", some ,thing);
}

A.    0 Wrong Right

B.    null Wrong Right

C.    0 0 Wrong Right

D.    error Wrong Right

Answer : 0 0

Explanation : This code is to show that preprocessor expressions are not the same as the ordinary expressions. If a name is not known the preprocessor treats it to be equal to zero.

Learn more problems on : Preprocessor Directives

Discuss on this question

10.

What keyword covers unhandled possibilities?

A.    all Wrong Right

B.    contingency Wrong Right

C.    default Wrong Right

D.    other Wrong Right

Answer : default

Explanation : There is no explanation...

Learn more problems on : Switch-case

Discuss on this question

11.

Write C code which will read a line of characters (terminated by a \n) from input_file into a character array called buffer. NULL terminate the buffer upon reading a \n.

A.    Example 1
int ch, loop = 0;
ch = fgetc( input_file );
while( (ch != '\n') && (ch != EOF) ) {
buffer[loop] = ch;
loop++;
ch = fgetc( input_file );
}
buffer[loop] = NULL;
Wrong Right

B.    Example 2
int ch, loop = 0;
ch = fgetc( input_file );
while( (ch = '\n') && (ch = EOF) ) {
buffer[loop] = ch;
loop--;
ch = fgetc( input_file );
}
buffer[loop] = NULL;
Wrong Right

C.    Example 3
int ch, loop = 0;
ch = fgetc( input_file );
while( (ch <> '\n') && (ch != EOF) ) {
buffer[loop] = ch;
loop++;
ch = fgetc( input_file );
}
buffer[loop] = -1;
Wrong Right

D.    Cannot be determined Wrong Right

Answer : Example 1
int ch, loop = 0;
ch = fgetc( input_file );
while( (ch != '\n') && (ch != EOF) ) {
buffer[loop] = ch;
loop++;
ch = fgetc( input_file );
}
buffer[loop] = NULL;

Explanation : There is no explanation...

Learn more problems on : File Handling

Discuss on this question

12.

What will the output of following C code?
void main()
{
int i=i++,j=j++,k=k++;
printf(ā€œ%d%d%dā€,i,j,k);
}

A.    Error Wrong Right

B.    Garbage values. Wrong Right

C.    Compiler error Wrong Right

D.    No output Wrong Right

Answer : Garbage values.

Explanation : An identifier is available to use in program code from the point of its declaration.
So expressions such as i = i++ are valid statements. The i, j and k are automatic variables and so they contain some garbage value. Garbage in is garbage out (GIGO).

Learn more problems on : Operators

Discuss on this question

13.

The library function used to find the last occurrence of a character in a string is?

A.    strnstr() Wrong Right

B.    laststr() Wrong Right

C.    strrchr() Wrong Right

D.    strstr() Wrong Right

Answer : strrchr()

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 *cptr,c;
void *vptr,v;
c=10; v=0;
cptr=&c; vptr=&v;
printf("%c%v",c,v);
}

A.    No output Wrong Right

B.    0 Wrong Right

C.    Compiler error Wrong Right

D.    None of these Wrong Right

Answer : Compiler error

Explanation : Compiler error (at line number 4): size of v is Unknown.

You can create a variable of type void * but not of type void, since void is an empty type. In the second line you are creating variable vptr of type void * and v of type void hence an error.


Learn more problems on : Pointers

Discuss on this question

15.

What will be printed as the result of the operation below?
#define swap(a,b) a=a+b;b=a-b;a=a-b;
void main()
{
int x=5, y=10;
swap (x,y);
printf("%d %d",x,y);
swap2(x,y);
printf("%d %d",x,y);
}
int swap2(int a, int b)
{
int temp;
temp=a;
b=a;
a=temp;
return 0;
}  

A.    5,10 Wrong Right

B.    10,5 Wrong Right

C.    0,5 Wrong Right

D.    10,0 Wrong Right

Answer : 10,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.