Questions

Q:

The output of the code below is

       #include <stdio.h>
        void main()
        {
            int i = 0, k;
            if ( i == 0 )
                goto label;
                for ( k = 0;k < 3; k++ )
                {
                    printf( "hin" );
                    label: k = printf( "%03d", i );
                }
         }

A) 0 B) hi hi hi 0 0 0
C) 0 hi hi hi 0 0 0 D) 0 0 0
 
Answer & Explanation Answer: A) 0

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Programming

1 20896
Q:

Find the odd word/letters/number from the given alternatives.

(A) BCE (B) WXZ (C) MNP (D) GHK

A) A B) B
C) C D) D
 
Answer & Explanation Answer: D) D

Explanation:
Report Error

View Answer Report Error Discuss

0 20864
Q:

Which of the statements given below are correct?

 

A) Max Verstappen won the Formula One 2017 Singapore Grand Prix.

B) In 2017, Mohamed Salah played for the Premier League team Liverpool.

C) Jelena Ostapenko won the Tennis 2017 Australian Open Women's Singles.

 

A) Only A B) Only B
C) Both B and C D) A, B and C
 
Answer & Explanation Answer: B) Only B

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Sports
Exam Prep: Bank Exams

0 20854
Q:

Number of eyes found in Earthworm..........

A) One B) Many
C) No eye D) Two
 
Answer & Explanation Answer: C) No eye

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Biology

145 20833
Q:

Which of the following parts of the sun is easily visible only during a total solar eclipse? 

A) core B) photosphere
C) sunspots D) corona
 
Answer & Explanation Answer: D) corona

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: General Science

139 20833
Q:

Between which of the following was the ancient town of Takshasila located

A) Indus and Jhelum B) Jhelum and Chenab
C) Chenab and Ravi D) Ravi and Beas
 
Answer & Explanation Answer: A) Indus and Jhelum

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian History

48 20831
Q:

What will be output when you will execute following c code?

#include <stdio.h>
enum actor

{
    SeanPenn=5,
    AlPacino=-2,
    GaryOldman,
    EdNorton
};
void main()

{
     enum actor a=0;
     switch(a)

      {
         case SeanPenn:  printf("Kevin Spacey");
                         break;
         case AlPacino:  printf("Paul Giamatti");
                         break;
         case GaryOldman:printf("Donald Shuterland");
                         break;
         case EdNorton:  printf("Johnny Depp");
      } 
}

A) Kevin Spacey B) Paul Giamatti
C) Donald Shuterland D) Johnny Depp
 
Answer & Explanation Answer: D) Johnny Depp

Explanation:

Default value of enum constant
GaryOldman = -2 +1 = -1
And default value of enum constant
EdNorton = -1 + 1 = 0
Note: Case expression can be enum constant.

Report Error

View Answer Report Error Discuss

Filed Under: Programming

1 20808
Q:

If the following program (myprog) is run from the command line as 

myprog 1 2 3 

what would be the output?

main(int argc, char *argv[])

{

    int i, j = 0;

    for (i = 0; i < argc ; i++)

           j = j + atoi ( argv[i]);

    printf ("%d", j);

}

A) 123 B) 6
C) Error D) "123"
 
Answer & Explanation Answer: B) 6

Explanation:

When atoi() tries to convert argv[0] to a number it cannot do so (argv[0] being a file name) and hence returns a zero.

Report Error

View Answer Report Error Discuss

Filed Under: Programming

2 20784