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.

Which is not a loop structure?

A.    For Wrong Right

B.    Do while Wrong Right

C.    While Wrong Right

D.    Repeat Until Wrong Right

Answer : Repeat Until

Explanation : There is no explanation...

Learn more problems on : Loops

Discuss on this question

2.

Write for loop which will read five characters (use scanf) and deposit them into the character based array words, beginning at element 0.

"/> A.    Statement 1
for( loop = 0; loop < 5; loop++ )
scanf("%c", &words[loop] );
Wrong Right

"/> B.    Statement 2
for( loop = 0; loop <= 5; loop++ )
scanf("%c", words );
Wrong Right

"/> C.    Statement 3
for( loop = 0; loop < 5; loop++ )
scanf("%c", &words[0] );
Wrong Right

D.    Cannot be detemined Wrong Right

Answer : Statement 1
for( loop = 0; loop < 5; loop++ )
scanf("%c", &words[loop] );

Explanation : There is no explanation...

Learn more problems on : Arrays

Discuss on this question

3.

Why can typecasting be dangerous?

A.    Some conversions are not defined, such as char to int. Wrong Right

B.    You might permanently change the value of the variable. Wrong Right

C.    You might temporarily lose part of the data - such as truncating a float when typecasting to an int. Wrong Right

D.    There are no dangers. Wrong Right

Answer : You might temporarily lose part of the data - such as truncating a float when typecasting to an int.

Explanation : There is no explanation...

Learn more problems on : Typecasting

Discuss on this question

4.

What is the output of this program?
main()
{
struct xx
{
int x;
struct yy
{
char s;
struct xx *p;
};
struct yy *q;
};
}

A.    No output Wrong Right

B.    Compiler Error Wrong Right

C.    Null Wrong Right

D.    None of these Wrong Right

Answer : Compiler Error

Explanation : The structure yy is nested within structure xx. Hence, the elements are of yy are to be accessed through the instance of structure xx, which needs an instance of yy to be known. If the instance is created after defining the structure the compiler will not know about the instance relative to xx. Hence for nested structure yy you have to declare member.

Learn more problems on : Structures

Discuss on this question

5.

What will be output when you will execute following c code?
#include
void main(){
int a=100;
if(a>10)
printf("M.S. Dhoni");
else if(a>20)
printf("M.E.K Hussey");
else if(a>30)
printf("A.B. de villiers");
}

A.    M.S. Dhoni Wrong Right

B.    A. B. de Villiers Wrong Right

C.    M.S. Dhoni M.E.K Hussey A.B. de Villiers Wrong Right

D.    Compilation Error Wrong Right

Answer : M.S. Dhoni

Explanation : There is no explanation...

Learn more problems on : If statements

Discuss on this question

6.

The statement which prints out the value of the character variable letter, is

A.    printf(letter); Wrong Right

B.    printf("%c", &letter); Wrong Right

C.    printf("%c", &letter); Wrong Right

D.    printf("%c", letter); Wrong Right

Answer : printf("%c", letter);

Explanation : There is no explanation...

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

Discuss on this question

7.

Which one is shows the hierarchy series of arithmetic operations in C?

A.    1. / * - Wrong Right

B.    2. * – / Wrong Right

C.    3. – / * Wrong Right

D.    4. / * - Wrong Right

Answer : 4. / * -

Explanation : There is no explanation...

Learn more problems on : C Basics

Discuss on this question

8.

A structure of type machine contains two fields, an integer called name, and a char pointer calledmemory. Show what the definition of the structure looks like.

A.    Choice 1
struct machine {
int name;
char memory;
}
Wrong Right

B.    Choice 2
machine {
name : integer;
memory : char^;
};
Wrong Right

C.    Choice 3
struct machine {
int name;
char *memory;
};
Wrong Right

D.    None of these Wrong Right

Answer : Choice 3
struct machine {
int name;
char *memory;
};

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 f(g,g2) g##g2
main()
{
int var12=100;
printf("%d",f(var,12));
}

A.    100 Wrong Right

B.    12 Wrong Right

C.    112 Wrong Right

D.    0 Wrong Right

Answer : 100

Explanation : There is no explanation...

Learn more problems on : Preprocessor Directives

Discuss on this question

10.

Which follows the case statement?

A.    : Wrong Right

B.    ; Wrong Right

C.    - Wrong Right

D.    A newline Wrong Right

Answer : :

Explanation : There is no explanation...

Learn more problems on : Switch-case

Discuss on this question

11.

How is a variable accessed from another file?

A.    The global variable is referenced via the extern specifier. Wrong Right

B.    The global variable is referenced via the auto specifier. Wrong Right

C.    The global variable is referenced via the global specifier. Wrong Right

D.    The global variable is referenced via the pointer specifier. Wrong Right

E.    The global variable is referenced via the ext specifier. Wrong Right

Answer : The global variable is referenced via the extern specifier.

Explanation : There is no explanation...

Learn more problems on : Defining Variables

Discuss on this question

12.

Using input_file, open the file results.dat for read mode.

A.    input_file = "results.dat" opened as "r"; Wrong Right

B.    open input_file as "results.dat" for "r"; Wrong Right

C.    fopen( input_file, "results.dat", "r" ); Wrong Right

D.    input_file = fopen( "results.dat", "r" ); Wrong Right

Answer : input_file = fopen( "results.dat", "r" );

Explanation : input_file = fopen( "results.dat", "r" );

Learn more problems on : File Handling

Discuss on this question

13.

What will the output of following C code?
main()
{
char *p;
int *q;
long *r;
p=q=r=0;
p++;
q++;
r++;
printf("%p...%p...%p",p,q,r);
}

A.    0004...0002...0001 Wrong Right

B.    0001...0002...0004 Wrong Right

C.    0002...0004...0008 Wrong Right

D.    0001...0002...0006 Wrong Right

Answer : 0001...0002...0004

Explanation : ++ operator when applied to pointers increments address according to their corresponding data-types.

Learn more problems on : Operators

Discuss on this question

14.

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


main()
{
char *p;
p="Hello";
printf("%c\n",*&*p);
}

A.    Garbage Value Wrong Right

B.    0 Wrong Right

C.    Compiler Error Wrong Right

D.    H Wrong Right

Answer : H

Explanation : There is no explanation...

Learn more problems on : Pointers

Discuss on this question

15.

What will be printed as the result of the operation below?
int x;
int modifyvalue()
{
return(x+=10);
}
int changevalue(int x)
{
return(x+=1);
}
void main()
{
int x=10;
x++;
changevalue(x);
x++;
modifyvalue();
printf("First output:%dn",x);
x++;
changevalue(x);
printf("Second output:%dn",x);
modifyvalue();
printf("Third output:%dn",x);
}

A.    12, 12, 12 Wrong Right

B.    12, 12, 13 Wrong Right

C.    12, 13, 13 Wrong Right

D.    13, 13, 13 Wrong Right

Answer : 12, 13, 13

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.