Will the program compile successfully?
#include
int main()
{
#ifdef NOTE
int a;
a=10;
#else
int a;
a=20;
#endif
printf("%d\n", a);
return 0;
}
What is the Error of this program?
#include
#define CONDITION(x)
printf("letsfindcourse");
int main()
{
CONDITION(0);
return 0;
}
What is the output of this program?
#include
#include
int main()
{
int *j = (int*)malloc(4 * sizeof(int));
*j = 15;
free(j);
printf("%d", *j);
return 0;
}
Queue data structure works on the principle of ____________
What will be the output of the following C code?
#include
main()
{
typedef int a;
a b=2, c=8, d;
d=(b*2)/2+8;
printf("%d",d);
}
Which of the following keywords is used to define an alternate name for an already existing data type?
What will be the output of the program (sample.c) given below if it is executed from the command line (Turbo C in DOS)?
cmd> sample 1 2 3
/* sample.c */
#include
int main(int argc, char *argv[])
{
int j;
j = argv[1] + argv[2] + argv[3];
printf("%d", j);
return 0;
}
What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog one two three
/* myprog.c */
#include
#include
int main(int argc, char **argv)
{
printf("%s\n", *++argv);
return 0;
}
The information about an array used in a program will be sorted in
#include
int main()
{
unsigned int i = 65000;
while (i++ != 0);
printf("%d", i);
return 0;
}
What will be the output of the program?
#include
int main()
{
int i;
i = printf("How r u\n");
i = printf("%d\n", i);
printf("%d\n", i);
return 0;
}
What will be the output of the program?
#include
int main()
{
int i;
char c;
for(i=1; i<=5; i++)
{
scanf("%c", &c); /* given input is 'b' */
ungetc(c, stdout);
printf("%c", c);
ungetc(c, stdin);
}
return 0;
}
What will be returned in the following C code?
size- t strlen(const char *s)
const char *sc;
for(sc = s; *sc!= ' \ O ' ; ++sc)
return(sc - s) ;
What is the output of this C code?
int main()
{
int i = 10;
int *p = &i;
foo(&p);
printf("%d ", *p);
printf("%d ", *p);
}
void foo(int **const p)
{
int j = 11;
*p = &j;
printf("%d ", **p);
}
Which of the following is the correct syntax to send an array as a parameter to function?
What is the output of this C code?
void main()
{
m();
void m()
{
printf("hi");
}
}
What is the correct and fully portable way to obtain the most significant byte of an unsigned integer x?
What is the output of this C code?
void main()
{
int x = 0, y = 2, z = 3;
int a = x & y | z;
printf("%d", a);
}
Suppose a program is divided into three files f1, f2 and f3, and a variable is defined in the file f1 but used in files f2 and f3. In such a case would we need the extern declaration for the variables in the files f2 and f3?
What is the output of the following program?
#include
void swap(int m, int n)
{
int x = m;
m = n;
n = x;
}
main()
{
int x=5, y=3;
swap(x,y);
printf("%d %d", x, y);
}
Total number of questions : 20
Number of answered questions : 0
Number of unanswered questions : 20
Will the program compile successfully?
#include
int main()
{
#ifdef NOTE
int a;
a=10;
#else
int a;
a=20;
#endif
printf("%d\n", a);
return 0;
}
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
What is the Error of this program?
#include
#define CONDITION(x)
printf("letsfindcourse");
int main()
{
CONDITION(0);
return 0;
}
Your Answer : (Not Answered)
Correct Answer : B
#define CONDITION(x) must be terminated my backslash () to follow the next line.
What is the output of this program?
#include
#include
int main()
{
int *j = (int*)malloc(4 * sizeof(int));
*j = 15;
free(j);
printf("%d", *j);
return 0;
}
Your Answer : (Not Answered)
Correct Answer : B
In this program, a pointer variable *j is declared and its memory space is allocated using malloc() and then an integer value 15 is set to a pointer variable *j. Now free(j) is used to free or delete the memory space allocated to the pointer variable *j using malloc(). While freeing the memory space allocated using malloc(), all allocated space will be deleted and by default the deleted space will be denoted by some garbage value and is outputted.
Queue data structure works on the principle of ____________
Your Answer : (Not Answered)
Correct Answer : C
No answer description available for this question.
What will be the output of the following C code?
#include
main()
{
typedef int a;
a b=2, c=8, d;
d=(b*2)/2+8;
printf("%d",d);
}
Your Answer : (Not Answered)
Correct Answer : A
In the code shown above, the keyword typedef is used to give an alias name (a) to an identifier of the type int. The expression on evaluation gives the answer 10. Hence the output of the code shown above is 10.
Which of the following keywords is used to define an alternate name for an already existing data type?
Your Answer : (Not Answered)
Correct Answer : C
The keyword typedef is used to define an alternate name for an already existing data type. It is mostly used for used defined data types.
What will be the output of the program (sample.c) given below if it is executed from the command line (Turbo C in DOS)?
cmd> sample 1 2 3
/* sample.c */
#include
int main(int argc, char *argv[])
{
int j;
j = argv[1] + argv[2] + argv[3];
printf("%d", j);
return 0;
}
Your Answer : (Not Answered)
Correct Answer : C
No answer description available for this question.
What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog one two three
/* myprog.c */
#include
#include
int main(int argc, char **argv)
{
printf("%s\n", *++argv);
return 0;
}
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
The information about an array used in a program will be sorted in
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
#include
int main()
{
unsigned int i = 65000;
while (i++ != 0);
printf("%d", i);
return 0;
}
Your Answer : (Not Answered)
Correct Answer : C
No answer description available for this question.
What will be the output of the program?
#include
int main()
{
int i;
i = printf("How r u\n");
i = printf("%d\n", i);
printf("%d\n", i);
return 0;
}
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
What will be the output of the program?
#include
int main()
{
int i;
char c;
for(i=1; i<=5; i++)
{
scanf("%c", &c); /* given input is 'b' */
ungetc(c, stdout);
printf("%c", c);
ungetc(c, stdin);
}
return 0;
}
Your Answer : (Not Answered)
Correct Answer : C
The ungetc() function pushes the character c back onto the named input stream, which must be open for reading.
This character will be returned on the next call to getc or fread for that stream.
One character can be pushed back in all situations.
A second call to ungetc without a call to getc will force the previous character to be forgotten.
What will be returned in the following C code?
size- t strlen(const char *s)
const char *sc;
for(sc = s; *sc!= ' \ O ' ; ++sc)
return(sc - s) ;
Your Answer : (Not Answered)
Correct Answer : B
The strlen() function is used to return the length of the string s.
What is the output of this C code?
int main()
{
int i = 10;
int *p = &i;
foo(&p);
printf("%d ", *p);
printf("%d ", *p);
}
void foo(int **const p)
{
int j = 11;
*p = &j;
printf("%d ", **p);
}
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
Which of the following is the correct syntax to send an array as a parameter to function?
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
What is the output of this C code?
void main()
{
m();
void m()
{
printf("hi");
}
}
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
What is the correct and fully portable way to obtain the most significant byte of an unsigned integer x?
Your Answer : (Not Answered)
Correct Answer : D
No answer description available for this question.
What is the output of this C code?
void main()
{
int x = 0, y = 2, z = 3;
int a = x & y | z;
printf("%d", a);
}
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
Suppose a program is divided into three files f1, f2 and f3, and a variable is defined in the file f1 but used in files f2 and f3. In such a case would we need the extern declaration for the variables in the files f2 and f3?
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
What is the output of the following program?
#include
void swap(int m, int n)
{
int x = m;
m = n;
n = x;
}
main()
{
int x=5, y=3;
swap(x,y);
printf("%d %d", x, y);
}
Your Answer : (Not Answered)
Correct Answer : B
5 3, call by value mechanism can’t alter actual arguments.
Total number of questions : 20
Number of answered questions : 0
Number of unanswered questions : 20
We'll write only best content for you