a) variable b) function c) typedef d) macros Answer: d
View QuestionWhich for loop has range of similar indexes of ‘i’ used in for (i = 0;i < n; i++)?
a) for (i = n; i>0; i–) b) for (i = n; i >= 0; i–) c) for (i ...
View QuestionThe C code ‘for(;;)’ represents an infinite loop. It can be terminated by ___________
a) break b) exit(0) c) abort() d) terminate Answer: a
View Question
What will be the output of the following C code?
#include < stdio.h >
int main()
{
float f = 1;
switch (f)
{
case 1.0:
printf(“yes\n”);
break;
default:
printf(“default\n”);
}
}
What will be the output of the following C code? #include < stdio.h >
View Question
What will be the output of the following C code?
#include < stdio.h >
int main()
{
int x = 97;
switch (x)
{
case ‘a’:
printf(“yes “);
break;
case 97:
printf(“no\n”);
break;
}
}
What will be the output of the following C code? #include < stdio.h >
View Question
What will be the output of the following C code?
#include < stdio.h >
int main()
{
int a = 1, b = 1;
switch (a)
{
case a*b:
printf(“yes “);
case a-b:
printf(“no\n”);
break;
}
}
What will be the output of the following C code? #include < stdio.h >
View Question
What will be the output of the following C code? (Assuming that we have entered the value 1 in the standard input)
#include < stdio.h >
void main()
{
int ch;
printf(“enter a value between 1 to 2:”);
scanf(“%d”, &ch);
switch (ch, ch + 1)
{
case 1:
printf(“1\n”);
break;
case 2:
printf(“2”);
break;
}
}
What will be the output of the following C code? (Assuming that we have entered the value 1 ...
View Question
What will be the output of the following C code? (Assuming that we have entered the value 2 in the standard input)
#include < stdio.h >
void main()
{
int ch;
printf(“enter a value between 1 to 2:”);
scanf(“%d”, &ch);
switch (ch)
{
case 1:
printf(“1\n”);
break;
printf(“hi”);
default:
printf(“2\n”);
}
}
What will be the output of the following C code? (Assuming that we have entered the value 2 ...
View Question
What will be the output of the following C code? (Assuming that we have entered the value 1 in the standard input)
#include < stdio.h >
void main()
{
int ch;
printf(“enter a value between 1 to 2:”);
scanf(“%d”, &ch);
switch (ch)
{
case 1:
printf(“1\n”);
default:
printf(“2\n”);
}
}
What will be the output of the following C code? (Assuming that we have entered the value 1 ...
View Question
What will be the output of the following C code? (Assuming that we have entered the value 1 in the standard input)
#include < stdio.h >
void main()
{
char *ch;
printf(“enter a value between 1 to 3:”);
scanf(“%s”, ch);
switch (ch)
{
case “1”:
printf(“1”);
break;
case “2”:
printf(“2”);
break;
}
}
What will be the output of the following C code? (Assuming that we have entered the value 1 ...
View Question