Time Left - 08:00 mins

RRB JE (IT) : C language + C++ language Quiz 6

Attempt now to get your rank among 513 students!

Question 1

What will be the output of the following pseudo-code?

int x;

if ( 2 < 1 );

else

x = (3 < 0) ? printf ("one") : printf ("seven:");

printf ("%d", x);

Question 2

If a = 5, b = 7 and c = 1, then the expression (a - a/b * b%c ) > a %b%c evaluates to

Question 3

The body of the following for loop

for (putchar ('a' ) ; putchar (0) ; putchar ( 'c' ) )

putchar('b');

will be executed

Question 4

Consider the following program segment

Static char x[3] = “1234”;

Cout < < x;

A complete C++ program with these two statements

Question 5

The following program fragment

void main( )

int x = 10;

int & P = x;

Cout <<  & p << & x;

}

Question 6

Choose the correct statements regarding inline functions.

Question 7

Consider the following code:

#include<stdio.h>
int main()

{

int a[] = {11,22,33,44,55,66};

int *p[] = {a, a+2, a+4, a+1, a+3, a+5};

int **ptr = p;

ptr++;

*ptr++;

++*ptr;

printf(“%d”, *ptr-a);

}

Output of the above code is

Question 8

Consider the following program fragment

Char *person[] = {“RAM”, “SHYAM”, “RAHIMA”}

Printf(“%c”, *(person+1)+2);

What will be the output of above program fragment,

Question 9

Reusability is a desirable feature of a language as it

Question 10

The declaration

int y; int &n = y;

is same as the declaration

int y, *n; n=& y;

This remark is

  • 513 attempts
  • 1 upvote
  • 0 comments
Oct 7GATE & PSU CS