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 produces the following output is, (hint: use two nested for loops)

 1
22
333
4444
55555

printf("\n");
}
"/> A.    Statement 1
for(a = 1; a <= 5; a = a + 1) {
for( b = 1; b <= 5; b = b + 1)
printf("%d", b);
printf("\n");
}
Wrong Right

printf("\n");
}
"/> B.    Statement 2
for( a = 1; a <= 5; a = a + 1) {
for( b = 1; b <= a; b = b + 1)
printf("%d", a);
printf("\n");
}
Wrong Right

printf("\n");
}
"/> C.    Statement 3
for( a = 1; a <= 5; a = a + 1) {
for( b = a; b <= 5; b = b + 1)
printf("%d", b);
printf("\n");
}
Wrong Right

printf("\n");
}
"/> D.    Statement 4
for( a = 1; a <= 5; a = a + 1) {
for( b = 1; b < a; b = b + a)
printf("%d", b);
printf("\n");
}
Wrong Right

Answer : Statement 2
for( a = 1; a <= 5; a = a + 1) {
for( b = 1; b <= a; b = b + 1)
printf("%d", a);
printf("\n");
}

Explanation : There is no explanation...

Learn more problems on : Loops

Discuss on this question

2.

Declare a multi dimensional array of floats called balances having three rows and five columns.

A.    float balances[3][5]; Wrong Right

B.    balances[3][5] of float; Wrong Right

C.    float balances[5][3]; Wrong Right

D.    array of float balances[0..2][0..5]; Wrong Right

Answer : float balances[3][5];

Explanation : There is no explanation...

Learn more problems on : Arrays

Discuss on this question

3.

Which of the following program structure/component/statement is not an example for implementation of modularization ? 

A.    DLL Wrong Right

B.    Functions Wrong Right

C.    type casting Wrong Right

D.    pointers Wrong Right

Answer : type casting

Explanation : Option c) type casting. DLL and Functions help in modularization of a program while typecasting just converts from one data type to another.

Learn more problems on : Typecasting

Discuss on this question

4.

Which of the following accesses a variable in structure b?

A.    b->var; Wrong Right

B.    b.var; Wrong Right

C.    b-var; Wrong Right

D.    b>var; Wrong Right

Answer : b.var;

Explanation : There is no explanation...

Learn more problems on : Structures

Discuss on this question

5.

The statement to read a decimal value from the keyboard, into the integer variable sum, is

A.    scanf("%d", &sum); Wrong Right

B.    scanf("%d", &sum); Wrong Right

C.    scanf("%s", sum); Wrong Right

D.    scanf("%f", &sum); Wrong Right

Answer : scanf("%d", &sum);

Explanation : There is no explanation...

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

Discuss on this question

6.

A nibble corresponds to

A.    4 bits Wrong Right

B.    8 bits Wrong Right

C.    16 bits Wrong Right

D.    32 bits Wrong Right

Answer : 4 bits

Explanation : There is no explanation...

Learn more problems on : C Basics

Discuss on this question

7.

Assign the value 10 to the field name using the pointer mpu641.

A.    mpu641.name = 10; Wrong Right

B.    mpu641->name = 10; Wrong Right

C.    mpu641.name = *10; Wrong Right

D.    *mpu641.name = 10; Wrong Right

Answer : mpu641->name = 10;

Explanation : There is no explanation...

Learn more problems on : Pointers & Structures

Discuss on this question

8.

What will be output if you will compile and execute the following c code?
01 #include
02 #define x 5+2
03 int main()
04 {
05 int i;
06 i=x*x*x;
07 printf("%d",i);
08 return 0;
09 }

A.    343 Wrong Right

B.    27 Wrong Right

C.    133 Wrong Right

D.    Compile Error Wrong Right

E.    None of above Wrong Right

Answer : 27

Explanation : There is no explanation...

Learn more problems on : Preprocessor Directives

Discuss on this question

9.

The correct define statement for a constant called GST with a value of .125, is

A.    #define GST 0.125 Wrong Right

B.    GST .125; Wrong Right

C.    float GST=0.125; Wrong Right

D.    #define GST .125; Wrong Right

Answer : #define GST 0.125

Explanation : There is no explanation...

Learn more problems on : Defining Variables

Discuss on this question

10.

What is the result of the following code?
int x=0;

switch(x)
{
case 1: printf( "One" );
case 0: printf( "Zero" );
case 2: printf( "Hello World" );
}

A.    One Wrong Right

B.    Zero Wrong Right

C.    Hello World Wrong Right

D.    ZeroHello World Wrong Right

Answer : ZeroHello World

Explanation : There is no explanation...

Learn more problems on : Switch-case

Discuss on this question

11.

What are the files which are automatically opened when a C file is executed?

A.    stdin Wrong Right

B.    stdin, stdout, stderr Wrong Right

C.    stdout Wrong Right

D.    None of these Wrong Right

Answer : stdin, stdout, stderr

Explanation : stdin, stdout, stderr (standard input, standard output, standard error).

Learn more problems on : File Handling

Discuss on this question

12.

What will the output of following C code?
void main()
{
static int i=i++, j=j++, k=k++;
printf(“i = %d j = %d k = %d”, i, j, k);
}

A.    i = 2 j = 1 k = 1 Wrong Right

B.    i = 1 j = 2 k = 0 Wrong Right

C.    i = 0 j = 0 k = 0 Wrong Right

D.    i = 1 j = 1 k = 1 Wrong Right

Answer : i = 1 j = 1 k = 1

Explanation : Since static variables are initialized to zero by default.

Learn more problems on : Operators

Discuss on this question

13.

Which one of the following will read a character from the keyboard and will store it in the variable c?

A.    c = getc(); Wrong Right

B.    getc( &c ); Wrong Right

C.    c = getchar( stdin ); Wrong Right

D.    getchar( &c ) Wrong Right

E.    c = getchar(); Wrong Right

Answer : c = getchar();

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 *str1="abcd";
char str2[]="abcd";
printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd"));
}

A.    2 5 3 Wrong Right

B.    0 Wrong Right

C.    2 5 5 Wrong Right

D.    2 3 4 Wrong Right

Answer : 2 5 5

Explanation : There is no explanation...

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=7;
void fun(){
printf("\n in fun a=%d",a);

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

B.    a=7 in fun a=7 Wrong Right

C.    a=7 in fun a=0 Wrong Right

D.    error Wrong Right

Answer : a=7 in fun a=7

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.