What is the output of this C code?
#include
int main()
{
printf("C programming %s", "Class by\n%s Sanfoundry", "WOW");
}
Which statment is true about the given code ?
#include
enum colors {lets,find,course};
int main()
{
printf("%d %d %d",course,lets,find);
return 0;
}
Choose the statement which is incorrect with respect to dynamic memory allocation.
#include "stdio.h"
typedef enum{
Male=5, Female
}SEX;
int main()
{
SEX var = Male;
SEX var1 = Female;
printf("%d %d",var, var1);
return 0;
}
Enumeration (or enum) is a ______ data type in C?
If scanf() is used to store a value in a char variable then along with the value a carriage return(\r) also gets stored it.
If the result underflow, the function returns zero.
How many macros are defined in the header file stdarg.h?
The library function clock() returns the number of _________ elapsed since the start of the program.
C preprocessor
What will be the output of the program?
#include
int main()
{
unsigned char i = 0x80;
printf("%d\n", i<<1>
What will be the output of the following C code?
#include
int main()
{
int c = 2 ^ 3;
printf("%d\n", c);
}
A printer produces a hard copy output on a physical medium such as
What will be the output of the program ?
#include
int main()
{
char str1[] = "Hello";
char str2[10];
char *t, *s;
s = str1;
t = str2;
while(*t=*s)
*t++ = *s++;
printf("%s\n", str2);
return 0;
}
What will strcmp() function do?
What does the following fragment of C-program print?
char c[] = "GATE2011";
char *p =c;
printf("%s", p + p[3] - p[1]) ;
What will be the output of the program ?
#include
int main()
{
char *p;
p="hello";
printf("%s\n", *&*&p);
return 0;
}
What will be the data type returned for the following function?
int func()
{
return (double)(char)5.0;
}
If return type for a function is not specified, it defaults to int
What is the output of this C code?
int main()
{
int x = 2, y = 2;
x /= x / y;
printf("%d\n", x);
return 0;
}
Total number of questions : 20
Number of answered questions : 0
Number of unanswered questions : 20
What is the output of this C code?
#include
int main()
{
printf("C programming %s", "Class by\n%s Sanfoundry", "WOW");
}
Your Answer : (Not Answered)
Correct Answer : C
This program has only one %s within first double quotes, so it does not read the string “WOW”.
The %s along with the Sanfoundry is not read as a format modifier while new line character prints the new line.
Output:
$ cc pgm2.c
$ a.out
C programming Class by
%s Sanfoundry
Which statment is true about the given code ?
#include
enum colors {lets,find,course};
int main()
{
printf("%d %d %d",course,lets,find);
return 0;
}
Your Answer : (Not Answered)
Correct Answer : C
enum assigns numbers starting from 0, if not explicitly defined by some other integer.
Choose the statement which is incorrect with respect to dynamic memory allocation.
Your Answer : (Not Answered)
Correct Answer : C
No answer description available for this question.
#include "stdio.h"
typedef enum{
Male=5, Female
}SEX;
int main()
{
SEX var = Male;
SEX var1 = Female;
printf("%d %d",var, var1);
return 0;
}
Your Answer : (Not Answered)
Correct Answer : D
No answer description available for this question
Enumeration (or enum) is a ______ data type in C?
Your Answer : (Not Answered)
Correct Answer : A
Enumeration (or enum) is a user defined data type in C. It is mainly used to assign names to integral constants, the names make a program easy to read and maintain.
If scanf() is used to store a value in a char variable then along with the value a carriage return(\r) also gets stored it.
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
If the result underflow, the function returns zero.
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
How many macros are defined in the header file stdarg.h?
Your Answer : (Not Answered)
Correct Answer : C
No answer description available for this question.
The library function clock() returns the number of _________ elapsed since the start of the program.
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
C preprocessor
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()
{
unsigned char i = 0x80;
printf("%d\n", i<<1>
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
What will be the output of the following C code?
#include
int main()
{
int c = 2 ^ 3;
printf("%d\n", c);
}
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
A printer produces a hard copy output on a physical medium such as
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()
{
char str1[] = "Hello";
char str2[10];
char *t, *s;
s = str1;
t = str2;
while(*t=*s)
*t++ = *s++;
printf("%s\n", str2);
return 0;
}
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
What will strcmp() function do?
Your Answer : (Not Answered)
Correct Answer : B
The strcmp() function compares the string s1 to the string s2.
int strcmp(const char *s1,const char *s2);
What does the following fragment of C-program print?
char c[] = "GATE2011";
char *p =c;
printf("%s", p + p[3] - p[1]) ;
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()
{
char *p;
p="hello";
printf("%s\n", *&*&p);
return 0;
}
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
What will be the data type returned for the following function?
int func()
{
return (double)(char)5.0;
}
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
If return type for a function is not specified, it defaults to int
Your Answer : (Not Answered)
Correct Answer : A
True, The default return type for a function is int.
What is the output of this C code?
int main()
{
int x = 2, y = 2;
x /= x / y;
printf("%d\n", x);
return 0;
}
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