The preprocessor can trap simple errors like missing declarations, nested comments or mismatch of braces.
The preprocessor directive which is used to remove the definition of an identifier which was previously defined with #define?
What will be the output of the following C code?
#include
#define max 100
void main()
{
#if(max)
printf("san");
#endif
printf("foundry");
}
Which one is used during memory deallocation in C?
What function should be used to free the memory allocated by calloc() ?
Which of the following is FALSE about typedef?
What is the output of this program?
#include
struct
{
int i;
float ft;
}decl;
int main(){
decl.i = 4;
decl.ft = 7.96623;
printf("%d %.2f", decl.i, decl.ft);
return 0;
}
If x is an array of interger, then the value of &x[i] is same as
In C, if you pass an array as an argument to a function, what actually gets passed?
How many times the while loop will get executed if a short int is 2 byte wide?
#include
int main()
{
int j=1;
while(j <= 255)
{
printf("%c %d\n", j, j);
j++;
}
return 0;
}
What is the output of this C code?
void main()
{
int i = 0;
int j = 0;
for (i = 0;i < 5 xss=removed> 1)
continue;
printf("Hi \n");
}
}
}
What is stderr ?
FILE is a structure suitably typedef'd in "stdio.h".
It is necessary that for the string functions to work safely the strings must be terminated with '\0'.
Left shifting an unsigned int or char by 1 is always equivalent to multiplying it by 2.
Which of the following is not an example of hardware?
Devices that allow you to put information into the computer.
What will be the value of var for the following C statement?
var = strcmp("Hello", "World");
What is the output of this C code?
void main()
{
int k = 5;
int *p = &k;
int **m = &p;
**m = 6;
printf("%d\n", k);
}
What is the output of this C code?
double foo();
int main()
{
foo();
return 0;
}
foo()
{
printf("2 ");
return 2;
}
Total number of questions : 20
Number of answered questions : 0
Number of unanswered questions : 20
The preprocessor can trap simple errors like missing declarations, nested comments or mismatch of braces.
Your Answer : (Not Answered)
Correct Answer : B
False, the preprocessor cannot trap the errors, it only replaces the macro with the given expression. But the compiler will detect errors.
The preprocessor directive which is used to remove the definition of an identifier which was previously defined with #define?
Your Answer : (Not Answered)
Correct Answer : B
#undef is used to remove the definition of any identifier which had been previously defined in the code with #define.
What will be the output of the following C code?
#include
#define max 100
void main()
{
#if(max)
printf("san");
#endif
printf("foundry");
}
Your Answer : (Not Answered)
Correct Answer : D
The code shown above is an illustration of the preprocessor directive #if. The value of the defined identifier max is 100. On checking the condition (100510==), which is true, the statements after #if are executed till #endif is encountered. Hence the output is sanfoundry.
Which one is used during memory deallocation in C?
Your Answer : (Not Answered)
Correct Answer : C
None
What function should be used to free the memory allocated by calloc() ?
Your Answer : (Not Answered)
Correct Answer : C
No answer description available for this question
Which of the following is FALSE about typedef?
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
What is the output of this program?
#include
struct
{
int i;
float ft;
}decl;
int main(){
decl.i = 4;
decl.ft = 7.96623;
printf("%d %.2f", decl.i, decl.ft);
return 0;
}
Your Answer : (Not Answered)
Correct Answer : A
In the above program the float variable ft is intialised to 7.96623, and it rounded of to 7.97 because of %.2f that we have mentioned in printf statement.
If x is an array of interger, then the value of &x[i] is same as
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
In C, if you pass an array as an argument to a function, what actually gets passed?
Your Answer : (Not Answered)
Correct Answer : C
No answer description available for this question.
How many times the while loop will get executed if a short int is 2 byte wide?
#include
int main()
{
int j=1;
while(j <= 255)
{
printf("%c %d\n", j, j);
j++;
}
return 0;
}
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
What is the output of this C code?
void main()
{
int i = 0;
int j = 0;
for (i = 0;i < 5 xss=removed> 1)
continue;
printf("Hi \n");
}
}
}
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
What is stderr ?
Your Answer : (Not Answered)
Correct Answer : C
No answer description available for this question.
FILE is a structure suitably typedef'd in "stdio.h".
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
It is necessary that for the string functions to work safely the strings must be terminated with '\0'.
Your Answer : (Not Answered)
Correct Answer : A
C string is a character sequence stored as a one-dimensional character array and terminated with a null character('\0', called NULL in ASCII).
The length of a C string is found by searching for the (first) NULL byte.
Left shifting an unsigned int or char by 1 is always equivalent to multiplying it by 2.
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
Which of the following is not an example of hardware?
Your Answer : (Not Answered)
Correct Answer : D
No answer description available for this question.
Devices that allow you to put information into the computer.
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
What will be the value of var for the following C statement?
var = strcmp("Hello", "World");
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
What is the output of this C code?
void main()
{
int k = 5;
int *p = &k;
int **m = &p;
**m = 6;
printf("%d\n", k);
}
Your Answer : (Not Answered)
Correct Answer : C
No answer description available for this question.
What is the output of this C code?
double foo();
int main()
{
foo();
return 0;
}
foo()
{
printf("2 ");
return 2;
}
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
Total number of questions : 20
Number of answered questions : 0
Number of unanswered questions : 20
We'll write only best content for you