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 of the following is a two-dimensional array?

A.    array anarray[20][20]; Wrong Right

B.    int anarray[20][20]; Wrong Right

C.    int array[20, 20]; Wrong Right

D.    char array[20]; Wrong Right

Answer : int anarray[20][20];

Explanation : There is no explanation...

Learn more problems on : Arrays

Discuss on this question

2.

The statement that prints out the character set from A-Z, is

"/> A.    Statement 1
for( a = 'A'; a < 'Z'; a = a + 1)
printf("%c", a);
Wrong Right

"/> B.    Statement 2
for( a = 'a'; a <= 'z'; a = a + 1)
printf("%c", &a);
Wrong Right

"/> C.    Statement 3
for( a = 'A'; a <= 'Z'; a = a + 1)
printf("%c", a);
Wrong Right

D.    Statement 4
for( a = 'Z'; a <= 'A'; a = a + 1)
Wrong Right

Answer : Statement 3
for( a = 'A'; a <= 'Z'; a = a + 1)
printf("%c", a);

Explanation : There is no explanation...

Learn more problems on : Loops

Discuss on this question

3.

What is argv[0]?

A.    The number of arguments to the program Wrong Right

B.    The name of the program Wrong Right

C.    The first argument to the program Wrong Right

D.    This syntax is illegal Wrong Right

Answer : The name of the program

Explanation : There is no explanation...

Learn more problems on : Command Line Arguments

Discuss on this question

4.

What will be the output?
main()
{
int i, j, *ptr, *ptr1;
i = 10;
j = 10;
ptr = &i;
ptr1 = &j;
if(ptr == ptr1)
{
printf("True");
}
else
{
printf("False");
}
}

A.    True Wrong Right

B.    False Wrong Right

C.    Syntax Error Wrong Right

D.    Run time Error Wrong Right

Answer : False

Explanation : In this program we are comparing the addresses contained by ptr & ptr1 not the value at those addresses and pointers ptr and ptr1 have the addresses of different variables so above condition is false

Learn more problems on : If statements

Discuss on this question

5.

The correct statement which assigns the character W to the char variable letter, is

A.    letter = "W"; Wrong Right

B.    letter = 'W'; Wrong Right

C.    char letter = "W"; Wrong Right

D.    strcpy( letter, "W" ); Wrong Right

Answer : letter = 'W';

Explanation : There is no explanation...

Learn more problems on : Assignments

Discuss on this question

6.

The statement to read a single character from the keyboard into the variable operator, skipping leading blanks, tabs and newline characters, is

A.    scanf("%s", operator); Wrong Right

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

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

D.    scanf(" %c", operator); Wrong Right

Answer : scanf(" %c", &operator);

Explanation : The leading space before the modifier %c informs scanf() to skip leading whitespace characters.

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

Discuss on this question

7.

C is which kind of language?

A.    Machine Wrong Right

B.    Procedural Wrong Right

C.    Assembly Wrong Right

D.    Object-oriented Wrong Right

E.    Strictly-typed Wrong Right

Answer : Procedural

Explanation : There is no explanation...

Learn more problems on : C Basics

Discuss on this question

8.

An array of pointers (10 elements) of type time (as detailed above in 7.), called sample is declared. Update the field month of the third array element to 12.

A.    *(sample[2]->month) = 12; Wrong Right

B.    sample[3].month = 12; Wrong Right

C.    *sample[2]->month = 12; Wrong Right

D.    *(sample[3]->month) = 12; Wrong Right

Answer : *(sample[2]->month) = 12;

Explanation : There is no explanation...

Learn more problems on : Pointers & Structures

Discuss on this question

9.

What will be the result of the following code?
#define TRUE 0
while(TRUE)
{
printf(“Wipro-BITS”);
}
printf(“BITS PILANI”);

A.    Wipro-BITS Wrong Right

B.    Nothing will be printed Wrong Right

C.    BITS Wrong Right

D.    BITS PILANI Wrong Right

Answer : BITS PILANI

Explanation : There is no explanation...

Learn more problems on : Preprocessor Directives

Discuss on this question

10.

What would be the output if option = 'H'?
switch(option)
{
case 'H' : printf("Hello");
case 'W' : printf("Welcome");
case 'B' : printf("Bye");
break;
}

A.    Hello Wrong Right

B.    Hello Welcome Wrong Right

C.    Hello Welcome Bye Wrong Right

D.    None of the above Wrong Right

Answer : Hello Welcome Bye

Explanation : If option = H then the first case is true so "Hello" gets printed but there is no break statement after this case to come out of the switch statement so the program execute all other case statements also and Hello Welcome Bye get printed.

Learn more problems on : Switch-case

Discuss on this question

11.

What will be output of the following c program?
#include
int main(){
int max-val=100;
int min-val=10;
int avg-val;
avg-val = max-val + min-val / 2;
printf("%d",avg-val);
return 0;
}  

A.    55 Wrong Right

B.    105 Wrong Right

C.    60 Wrong Right

D.    Compilation error Wrong Right

E.    None of these Wrong Right

Answer : Compilation error

Explanation : We cannot use special character – in the variable name.  

Learn more problems on : Defining Variables

Discuss on this question

12.

The statement that defines an input file handle called input_file, which is a pointer to type FILE, is

A.    type input_file as FILE; Wrong Right

B.    FILE *input_file; Wrong Right

C.    input_file FILE; Wrong Right

D.    *FILE input_file; Wrong Right

Answer : FILE *input_file;

Explanation : There is no explanation...

Learn more problems on : File Handling

Discuss on this question

13.

What will the output of following C code?
main()
{
int i=0;
while(+(+i--)!=0)
i-=i++;
printf("%d",i);
}

A.    0 Wrong Right

B.    -1 Wrong Right

C.    -2 Wrong Right

D.    1 Wrong Right

Answer : -1

Explanation : Unary + is the only dummy operator in C. So it has no effect on the expression and now the while loop is, while(i--!=0) which is false and so breaks out of while loop. The value –1 is printed due to the post-decrement operator.

Learn more problems on : Operators

Discuss on this question

14.

What will be the output of following C code?

main()
{
while (strcmp(“some”,”some\0”))
printf(“Strings are not equal\n”);
}

A.    No output Wrong Right

B.    Error Wrong Right

C.    Compiler Error Wrong Right

D.    Strings are not equal Wrong Right

Answer : No output

Explanation : Ending the string constant with \0 explicitly makes no difference. So “some” and “some\0” are equivalent. So, strcmp returns 0 (false) hence breaking out of the while loop.

Learn more problems on : Inbuilt Functions

Discuss on this question

15.

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


main()
{
char *p;
p="%d\n";
p++;
p++;
printf(p-2,300);
}

A.    400 Wrong Right

B.    100 Wrong Right

C.    200 Wrong Right

D.    300 Wrong Right

Answer : 300

Explanation : The pointer points to % since it is incremented twice and again decremented by 2, it points to '%d\n' and 300 is printed.

Learn more problems on : Pointers

Discuss on this question

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