logo

Crowdly

Browser

Add to Chrome

Questions Bank (1394417 total)

How many times does the while loop run?

#include <stdio.h>

int main()

{

  int i = 1;

  while (i <= 5)

    printf("%d ", i++);

  putchar('\n');

  return 0;

}

View this question
Which of the following loop statements is/are valid in C?

View this question

Which of these statements is/are true?

View this question

The principles of top–down design and structured programming dictate that a program should be divided into a main module and its related modules. 

100%
0%
View this question

The address operator (&) is used to tell the compiler to store data at an address. 

0%
100%
View this question

What is the output of the following program that compiles correctly? (Hint: When evaluating logical operators, the compiler ignores the remainder of the expression when it is sure of the final answer at any point of evaluation of the sub-expression - something often referred to as "short-circuit evaluation". This is a cryptic hint, I know, but enjoy unravelling it and discovering its meaning and implication!)

#include <stdio.h>
int main()

{

int a= -2, b= -1, c = 0, d = 1, e = 2;

int r1, r2;

r2 = a++ || ++b || c++ || ++d || e;

r1 = a && b++ && ++c && d++ && ++e;

printf("%d %d %d\n", r1,r2,a+b+c+d+e);

return 0;

}

View this question

What would be the output if the following code segment is compiled and run?

int a=100;

if (a >= 10)

   printf("Theory\n");

else if (a >= 20)

   printf("Lab\n");

else if (a >= 30)

   printf("Quiz\n");

View this question

Which

of the following statements about the sizeof() operator in C is true?

View this question

Given

the formula for motion

d = ut + ½at2

, which of the following

correctly calculates d?

0%
0%
0%
0%
View this question

Which of these data types is/are detected by the

compiler as erroneous?

0%
0%
0%
0%
0%
View this question