How to declare a wide character in the string literal?
The rule for implicit type conversion in 'C' is
What will be the output of the following C code?
#define sqr(x) x*x
main()
{
int a1;
a1=25/sqr(5);
printf("%d",a1);
}
What is the use of "#pragma once"?
Assume integer is 2 bytes wide. What will be the output of the following code?
#include
#include
#define MAXROW 3
#define MAXCOL 4
int main()
{
int (*p)[MAXCOL];
p = (int (*) [MAXCOL])malloc(MAXROW *sizeof(*p));
printf("%d, %d\n", sizeof(p), sizeof(*p));
return 0;
}
Which header file should be included to use functions like malloc() and calloc()?
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;
}
Find the output of below C program
#include "stdio.h"
typedef enum{
Male, Female
}SEX;
int main()
{
SEX var = Male;
printf("%d",var);
return 0;
}
The following program
main( )
{
static int a[ ] = { 7, 8, 9 } ;
printf( "%d", 2[ a ] + a[ 2 ] ) ;
}
C does no automatic array bound checking. This is
What will be the output of the program?
#include
int main()
{
int i = 1;
switch(i)
{
printf("Hello\n");
case 1:
printf("Hi\n");
break;
case 2:
printf("\nBye\n");
break;
}
return 0;
}
What will be the output of the program?
#include
int main()
{
float a = 0.7;
if(0.7 > a)
printf("Hi\n");
else
printf("Hello\n");
return 0;
}
What will function gcvt() do?
Bitwise can be used to perform addition and subtraction.
What will be the output of the program ?
#include
#include
int main()
{
char sentence[80];
int i;
printf("Enter a line of text\n");
gets(sentence);
for(i=strlen(sentence)-1; i >=0; i--)
putchar(sentence[i]);
return 0;
}
What will be the output of the following C code?
char str1[] = "Helloworld ";
char str2[] = "Hello";
len = strspn(str1, str2);
printf("Length of initial segment matching %d\n", len );
What is the output of this C code?
void main()
{
int x = 0;
int *ptr = &5;
printf("%p\n", ptr);
}
What is the output of this C code?
void main()
{
int x = 0;
int *ptr = &x;
printf("%p\n", ptr);
ptr++;
printf("%p\n ", ptr);
}
What will be the output of the following C code?
#include
int main()
{
int i = 97, *p = &i;
foo(&i);
printf("%d ", *p);
}
void foo(int *p)
{
int j = 2;
p = &j;
printf("%d ", *p);
}
What is the output of this C code?
int main()
{
int i = 10;
int *p = &i;
printf("%d\n", *p++);
}
Total number of questions : 20
Number of answered questions : 0
Number of unanswered questions : 20
How to declare a wide character in the string literal?
Your Answer : (Not Answered)
Correct Answer : A
It can turn this as the wide character instead of narrow characters.
The rule for implicit type conversion in 'C' is
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
What will be the output of the following C code?
#define sqr(x) x*x
main()
{
int a1;
a1=25/sqr(5);
printf("%d",a1);
}
Your Answer : (Not Answered)
Correct Answer : A
The output of the code shown above is 25. This is because the arithmetic statement takes the form of: 25/5*5 (which is equal to 1). If the macro had been defined as #define sqr(x) (x*x), the output would have been 1.
What is the use of "#pragma once"?
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
Assume integer is 2 bytes wide. What will be the output of the following code?
#include
#include
#define MAXROW 3
#define MAXCOL 4
int main()
{
int (*p)[MAXCOL];
p = (int (*) [MAXCOL])malloc(MAXROW *sizeof(*p));
printf("%d, %d\n", sizeof(p), sizeof(*p));
return 0;
}
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question
Which header file should be included to use functions like malloc() and calloc()?
Your Answer : (Not Answered)
Correct Answer : B
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.
Find the output of below C program
#include "stdio.h"
typedef enum{
Male, Female
}SEX;
int main()
{
SEX var = Male;
printf("%d",var);
return 0;
}
Your Answer : (Not Answered)
Correct Answer :
The following program
main( )
{
static int a[ ] = { 7, 8, 9 } ;
printf( "%d", 2[ a ] + a[ 2 ] ) ;
}
Your Answer : (Not Answered)
Correct Answer : D
a[2] will be converted to *(a + 2).
*(a + 2) can as well be written as *(2 + a ) .
*(2 + a ) is nothing but 2 [a] . So. a [2] is essentially same as 2 [a] which is same as * ( 2 + a ). So. it prints 9 + 9 = 18. Some of the modem compilers don't accept 2[a].
C does no automatic array bound checking. This is
Your Answer : (Not Answered)
Correct Answer : D
No answer description available for this question.
What will be the output of the program?
#include
int main()
{
int i = 1;
switch(i)
{
printf("Hello\n");
case 1:
printf("Hi\n");
break;
case 2:
printf("\nBye\n");
break;
}
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()
{
float a = 0.7;
if(0.7 > a)
printf("Hi\n");
else
printf("Hello\n");
return 0;
}
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
What will function gcvt() do?
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
Bitwise can be used to perform addition and subtraction.
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
What will be the output of the program ?
#include
#include
int main()
{
char sentence[80];
int i;
printf("Enter a line of text\n");
gets(sentence);
for(i=strlen(sentence)-1; i >=0; i--)
putchar(sentence[i]);
return 0;
}
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
What will be the output of the following C code?
char str1[] = "Helloworld ";
char str2[] = "Hello";
len = strspn(str1, str2);
printf("Length of initial segment matching %d\n", len );
Your Answer : (Not Answered)
Correct Answer : B
The length of the maximum initial segment of the string str1 which consists entirely of characters from the string str2 is computed by strspn().
What is the output of this C code?
void main()
{
int x = 0;
int *ptr = &5;
printf("%p\n", ptr);
}
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;
int *ptr = &x;
printf("%p\n", ptr);
ptr++;
printf("%p\n ", ptr);
}
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
What will be the output of the following C code?
#include
int main()
{
int i = 97, *p = &i;
foo(&i);
printf("%d ", *p);
}
void foo(int *p)
{
int j = 2;
p = &j;
printf("%d ", *p);
}
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
What is the output of this C code?
int main()
{
int i = 10;
int *p = &i;
printf("%d\n", *p++);
}
Your Answer : (Not Answered)
Correct Answer : A
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