Q221
Open question#include <stdio.h>
int X(char *s, FILE *iop)
{
int c;
while (c = *s++)
putc(c, iop);
return ferror(iop) ? EOF : 0;
}Select an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
296
Questions
12/15
Page
Pick an option on a question to see the right answer and solution.
Q221
Open question#include <stdio.h>
int X(char *s, FILE *iop)
{
int c;
while (c = *s++)
putc(c, iop);
return ferror(iop) ? EOF : 0;
}Select an option to see the answer and solution.
Q222
Open questionSelect an option to see the answer and solution.
Q223
Open question#include <stdio.h>
int main()
{
char n[20];
fgets(n, 19, stdin);
ungetc(n[0], stdin);
scanf("%s", n);
printf("%s\n", n);
return 0;
}Select an option to see the answer and solution.
Q224
Open questionSelect an option to see the answer and solution.
Q225
Open question#include <stdio.h>
#include <stdarg.h>
void func(int, ...);
int main()
{
func(2, 3, 5, 7, 11, 13);
return 0;
}
void func(int n, ...)
{
int number, i = 0;
va_list start;
va_start(start, n);
while (i != 3)
{
number = va_arg(start, int);
i++;
}
printf("%d", number);
}Select an option to see the answer and solution.
Q226
Open question#include <stdio.h>
int main()
{
char n[] = "hello\nworld!";
char s[13];
sscanf(n, "%s", s);
printf("%s\n", s);
return 0;
}Select an option to see the answer and solution.
Q227
Open question#include <stdio.h>
#include <ctype.h>
int main()
{
int i = 32;
if (isspace(i))
printf("space\n");
else
printf("not space\n");
return 0;
}Select an option to see the answer and solution.
Q228
Open question#include <stdio.h>
#include <stdarg.h>
int f(int c, ...);
int main()
{
int c = 97;
float d = 98;
f(c, d);
return 0;
}
int f(int c, ...)
{
va_list li;
va_start(li, c);
float d = va_arg(li, float);
printf("%f\n", d);
va_end(li);
}Select an option to see the answer and solution.
Q229
Open questionSelect an option to see the answer and solution.
Q230
Open questionchar or EOF.isalnum(c) returnsSelect an option to see the answer and solution.
Q231
Open questionSelect an option to see the answer and solution.
Q232
Open questionSelect an option to see the answer and solution.
Q233
Open question#include <stdio.h>
int main()
{
srand(time(NULL));
printf("%d\n", rand());
return 0;
}Select an option to see the answer and solution.
Q234
Open question#include <stdio.h>
int main()
{
int i = 10, j = 3, k = 3;
printf("%d %d ", i, j, k);
}Select an option to see the answer and solution.
Q235
Open questionint fgetpos(FILE *stream, fpos_t *s)Select an option to see the answer and solution.
Q236
Open question#include <stdio.h>
#include <string.h>
int main()
{
char line[3];
fgets(line, 3, stdin);
printf("%d\n", line[2]);
return 0;
}Select an option to see the answer and solution.
Q237
Open questionchar str[] =”Too Good”;
printf(“\n %7s”,str);Select an option to see the answer and solution.
Q238
Open question#include <stdio.h>
#include <math.h>
void main()
{
int k = pow(2, 3);
printf("%d\n", k);
}Select an option to see the answer and solution.
Q239
Open questionSelect an option to see the answer and solution.
Q240
Open question#include <stdio.h>
int main()
{
char *s = "myworld";
int i = 9;
printf("%*s", i, s);
}Select an option to see the answer and solution.