-
Which one of the following is NOT a default promotion?
1) If either operand of an arithmetic operator is unsigned long, the other operand is promoted to unsigned long. 2) If either operand of an arithmetic operator is unsigned int, the other operand is promoted to unsigned int. 3) If either operand of an arithmetic operator is int, the other operand is promoted to int. 4) If either operand of an arithmetic operator is double, the other operand...
-
Integral data type
which one of the following is not an integral data type 1. Character 2. Boolean 3. Integer 4. Pointer type
-
-
-
-
-
Find the factorial of given positive integer.
Consider the following code for finding the factorial of given positive integer IFACT=1 DO 100 I=2,N,2 100 IFACT = IFACT*i*(i-1) For which value of N, the above FORTRAN code will not work ? 1. N is even 2. N is odd 3. N is perfect number 4. N mod 3 =0
-
-
Output of these programs.
c
struct Foo
{
char *pName;
};
main()
{
struct Foo *obj = malloc(sizeof(struct Foo));
clrscr();
strcpy(obj->pName,"Your Name");
printf("%s", obj->pName);
}
a. Your Name
b. compile error
c. Name
d. Runtime error
c
struct Foo
{
char *pName;
char *pAddress;
}; -
-
-
-
-
-
-
-
Why should I prototype a function?
A function prototype tells the compiler what kind of arguments a function is looking to receive and what kind of return value a function is going to give back. This approach helps the compiler ensure that calls to a function are made correctly and that no erroneous type conversions are taking place.
-
-
-
C Interview Questions
Ans