MCQ1 mark
What does the following fragment of C program print?
char c[] = "GATE2011";
char *p = c;
printf("%s", p + p[3] - p[1]);Single correct
Answer key coming soon
GATE CSE previous year questions · Programming & Data Structures
char c[] = "GATE2011";
char *p = c;
printf("%s", p + p[3] - p[1]);Single correct
Answer key coming soon
unsigned int foo(unsigned int n, unsigned int r) {
if (n>0) return ((n%r) + foo(n/r, r));
else return 0;
}
What is the return value of the function foo when it is called as foo(345, 10)?Single correct
Answer key coming soon
unsigned int foo(unsigned int n, unsigned int r) {
if (n>0) return ((n%r) + foo(n/r, r));
else return 0;
}
What is the return value of the function foo when it is called as foo(513, 2)?Single correct
Answer key coming soon