Choose the function that is most appropriate for reading in a multi-word string?
AnswerChoose the correct order from given below options for the calling function of the code “a = f1(23, 14) * f2(12/4) + f3();”?
AnswerWhat actually get pass when you pass an array as a function argument?
AnswerSimilarity between a structure, union and enumeration,
AnswerThe prototype of a function can be used to,
AnswerWhat is the output of the following program?
#include<stdio.h>
main()
{
char s[] = "Hello\0Hi";
printf("%d %d", strlen(s), sizeof(s));
}
Answer
To store a word/sentence declare a variable of the type ‘string’.
AnswerWhat is the output of the following program?
#include<stdio.h>
main()
{
int i = 13, j = 60;
i ^= j;
j ^= i;
i ^= j;
printf("%d %d", i, j);
}
Answer
What is the output of the following program?
#include<stdio.h>
main()
{
int i = 1;
while( i++<=5 )
printf("%d ",i++);
}
Answer
What is the output of the below code snippet?
#include<stdio.h>
main()
{
int a = 1;
float b = 1.3;
double c;
c = a + b;
printf("%.2lf", c);
}
Answer
What value is returned by function func?
float func(){
int r = 0, d = 0, i=0;
for (i; i < 2; i++) {
r += 5 / d;
}
return r;
}
Answer
When running the code below, line 7 that increments y will always be executed at runtime.
1
2 int main()
3 {
4 int x = 0;
5 int y = 0;
6 if (!x){
7 y++;
8 }
9 return 0;
10 }
Answer
What gets printed?
01 #include <stdio.h>
02
03 int main()
04 {
05 int ints[] = { 0, 1, 2, 3 };
06 int* i1 = ints + 1;
07 int* i2 = ints + 2;
08 int a = ++*i1 + *i2++;
09 int b = *++i1 + *i2--;
10 printf("%d#%d", a, b);
11 return 0;
12 }
Answer
What gets printed?
#include <stdio.h>
int main()
{
int ints[] = { 0, 5, 10, 15 };
int* i2 = ints + 2;
int a = *i2++;
printf("%d#%d\n", a, *i2);
return 0;
}
Answer
what gets printed?
#include <stdio.h>
int main()
{
int ints[] = { 0, 1, 2, 3 };
int* i1 = ints + 1;
int a = ++*i1;
int b = a + *i1;
printf("%d\n", b);
return 0;
}
Answer
What gets printed?
printf("%d\n", 4 ?: 8);
Answer
What gets printed?
int i = 3;
if (!i)
i++;
i++;
if (i==3)
i+=2;
i+=2;
printf("%d\n", i);
Answer
What gets printed?
int array[2][2] = {0, 1, 2, 3};
int i;
int sum = 0;
for (i =0; i < 4; ++i){
int x, y;
x = i % 2;
if (x){
y = 0;
}
else{
y = 1;
}
sum += array[x][y];
}
printf("%d\n", sum);
Answer
What gets printed by the code below? (Assume 1 byte characters)
char array[] = "foo";
printf("%lu\n", sizeof(array[1]));
Answer
What value gets printed by the program below?
int w = 3;
int x = 31;
int y = 10;
double z = x / y % w;
printf("%f\n", z);
Answer
© 2017 QuizBucket.org