What happens if you try to compile and run this program?
#include
int main (int argc, char *argv[]) {
int i =2, j = 1;
if(i / j)
j += j;
else
i += i;
printf("%d",i + j);
return 0;
}
Choose the right answer:
What happens if you try to compile and run this program?
#include
int main (int argc, char *argv[]) {
int i = 'A' - 'B';
int j = 'b' - 'a';
printf("%d",i / j);
return 0;
}
Choose the right answer:
What happens if you try to compile and run this program?
#include
struct s {
int i;
};
void fun(struct S st) {
st.i --;
int main (void) {
int k;
struct $ str1 = { 2 };
fun (str1) ;
k =str1.i;
printf("%d", k);
return 0;
}
-
Choose the correct answer:
What happens if you try to compile and run this program?
#include
int main (int argc, char *argv[]) {
float f = 1e1 + 2e0 + 3e-1;
printf("%f ",f);
return 0;
}
Choose the right answer:
What happens if you try to compile and run this program?
#include
int main (int argc, char *argv[]) {
int i = 2;
int d= i << 2;
d /= 2;
printf ("%d", d) ;
return 0;
}
Choose the right answer:
What happens if you try to compile and run this program?
#include
#include
struct STR {
int i;
char c[20];
float f;
};
int main (int argc, char *argv[]) {
struct STR str = { 1, "Hello", 3 };
printf("%d", str.i + strlen(str.c));
return 0;
}
Choose the right answer:
What happens when you compile and run the following program?
#include
#define SYM
#define BOL 100
#undef SYM
int main (void) {
#ifdef SYM
int i = 100;
#else
int i= 200;
#endif
int j = i + 200;
printf("%d",i+j);
return 0;
}
Select the correct answer:
What happens if you try to compile and run this program?
#include
int f1(int n) {
return n = n * n;
}
int f2(int n) {
return n = f1(n) * f1(n);
}
int main(int argc, char ** argv) {
printf ("%d \n", f2(1));
return 0;
}
-
Select the correct answer:
What happens if you try to compile and run this program?
#include
int main (int argc, char *argv[]) {
char *p = "World";
int i = 2;
switch (p[i]) {
case 'W' :i++; break ;
case 'o' :i += 2; break ;
case 'r' :i += 3; break ;
case '1' :i += 4; break ;
case 'd' :i += 5; break ;
default :i += 4;
}
printf("%d", i);
return 0;
}
-
Choose the right answer: