How many times the while loop will get executed if a short int is 2 byte wide?
#include<stdio.h>
int main()
{
int j=
while(j <=
{
printf("%c %d\n", j, j);
j++;
}
return
}
Which of the following sentences are correct about a for loop in a C program?
| 1: | for loop works faster than a while loop. |
| 2: | All things that can be done using a for loop can also be done using a while loop. |
| 3: | for(;;); implements an infinite loop. |
| 4: | for loop can be used if we want statements in a loop get executed at least once. |
What will be the output of the program?
#include<stdio.h>
int main()
{
char str[]="C-program";
int a = printf(a >10?"Ps\n":"%s\n", str);
return}
Which of the following is not logical operator?
Which of the following statements are correct about the below program?
#include<stdio.h>
int main()
{
int n =y = y == 1 ? n=0 : n= if(n)
printf("Yes\n");
else
printf("No\n");
return}
What will be the output of the program?
#include<stdio.h>
int main()
{
int a =b =c;
if(!a >= b = c = printf("b = %d c = %d\n", b, c);
return}
In mathematics and computer programming, which is the correct order of mathematical operators ?
Which of the following sentences are correct about a switch loop in a C program?
| 1: | switch is useful when we wish to check the value of variable against a particular set of values. |
| 2: | switch is useful when we wish to check whether a value falls in different ranges. |
| 3: | Compiler implements a jump table for cases used in switch. |
| 4: | It is not necessary to use a break in every switch statement. |
What will be the output of the program?
#include<stdio.h>
int main()
{
unsigned int i =/* Assume 2 byte integer*/
while(i++ != printf("%d",++i);
printf("\n");
return}
Which of the following cannot be checked in a switch-case statement?
What will be the output of the program?
#include<stdio.h>
int main()
{
int x = float y = 3. if(x == y)
printf("x and y are equal");
else
printf("x and y are not equal");
return}