If abc is the input, then the following program fragment
char x, y, z ;
printf ("% d" , scanf ("%c%c%c" , &x , &y , &z )) ;
results in
Answer: D
No answer description available for this question.
Enter details here
The constants are also called as _____________
Answer: C
No answer description available for this question.
Enter details here
Choose the correct answer
Answer: C
No answer description available for this question.
Enter details here
The minimum number of temporary variables needed to swap the contents of two variables is
Answer:
Enter details here
The statement
printf( " % f ", ( float )9/5) ;
prints
Answer: A
No answer description available for this question.
Enter details here
Comment on the output of this C code?
#include
void main()
{
int k = 4;
int *const p = &k;
int r = 3;
p = &r;
printf("%d", p);
}
Answer: C
Since the pointer p is declared to be constant, trying to assign it with a new value results in an error.
Output:
$ cc pgm11.c
pgm11.c: In function ‘main’:
pgm11.c:7: error: assignment of read-only variable ‘p’
pgm11.c:8: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘int * const’
Enter details here
The difference between x and ‘x’ is?
Answer: A
In a C++ code, names with quotes like ‘x’ represent a character or string(in case of a collection of characters) whereas without quotes they represent an identifier.
Enter details here
------not a secondry constant.
Answer: A
No answer description available for this question.
Enter details here
What is the output of this C code?
#include
#define a 10
int main()
{
const int a = 5;
printf("a = %d\n", a);
}
Answer: C
The #define substitutes a with 10 leaving no identifier and hence compilation error.
Output:
$ cc pgm3.c
pgm3.c: In function ‘main’:
pgm3.c:5: error: expected identifier or ‘(’ before numeric constant
Enter details here
C programming language provides operations which deal directly with objects such as
Answer: C
No answer description available for this question.
Enter details here