-
In the following code, what is p2? typedef int* ptr ptr p1, p2;
A) an integer B) an integer pointerC) a pointerD) None of the above
-
-
-
-
How can you determine the maximum value that a numeric variable can hold?
For integral types, on a machine that uses two’s complement arithmetic (which is just about any machine you’re likely to use), a signed type can hold numbers from –2(number of bits – 1) to +2(number of bits – 1) – 1. An unsigned type can hold values from 0 to +2(number of bits) – 1. For instance, a 16-bit signed integer can hold numbers from –2^15 (–32768) to +2^15 – 1 (32767).
-
-
-
-
main()
{
int i;
clrscr();
printf("%d", &i)+1;
scanf("%d", i)-1;
}Main() { int i; clrscr(); printf("%d", &i)+1; scanf("%d", i)-1; }
A) Runtime error. Access violationB) Compile error. Illegal syntaxC) None of the aboveD) Runtime errorExplanation: printf( ) prints address/garbage of i, scanf() dont have & sign, so scans address for i +1, -1 dont have any effect on code.
-
How will you print % character?
A) printf(“%%”)B) printf(“\%”)C) printf(“%”)D) printf(“%%”)
-
-
-
-
-
-
-
-
-
-
C Interview Questions
Ans