What will be the output of the following code?#include <stdio.h>
int main() {
int a, b, c;
a = 0x10; b = 010;
c = a + b;
printf("%d", c);
return 0;
}
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. 24
Explanation
0x10 is hexadecimal 16 and 010 is octal 8, so c = 24.More Programming Languages and Computer Graphics questions
- A three-dimensional array in C++ is declared as int A[a][b][c]. Array elements are stored in row-major order and indexing begins from 0. Th…
- What is the output of the following code?main() { struct s1 { char *z; int i; struct s1 *p; }; static struct s1 a[] = { {"Nagpur", 1, a+1},…
- The Sutherland-Hodgeman method is used on
- What is x in the following program?#include <stdio.h> int main() { typedef int (*(*arrfptr[3])())[10]; arrfptr x; return 0; }
- How will you free the memory allocated by the following program?#include <stdio.h> #include <stdlib.h> #define MAXROW 3 #define MAXCOL 4 in…
- The clipping process in computer graphics is used for