Constants in C can be divided into categories ?
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;
}
typedef int (*PFI)(char *, char *)creates ___________
What will be the output of the following C code?
#include
int *(*(x()))[2];
typedef int **(*ptrfoo)())[2];
int main()
{
ptrfoo ptr1;
ptr1 = x;
ptr1();
return 0;
}
int *(*(x()))[2]
{
int (*ary)[2] = malloc(sizeof * ary);
return &ary;
}
A program P reads in 500 integers in the range [0..100] exepresenting the scores of 500 students. It then prints the frequency of each score above 50. What would be the best way for P to store the frequencies?
When does the ArrayIndexOutOfBoundsException occur?
Point out the error, if any in the program.
#include
int main()
{
int i = 1;
switch(i)
{
case 1:
printf("Case1");
break;
case 1*2+4:
printf("Case2");
break;
}
return 0;
}
How many times GeeksQuiz is printed
#include
int main()
{
int i = -5;
while (i <= 5)
{
if (i >= 0)
break;
else
{
i++;
continue;
}
printf("GeeksQuiz");
}
return 0;
}
Which of the following library functions returns the time in UTC (Greenwich mean time) format?
Bitwise can be used to reverse a sign of a number.
Bitwise can be used to generate a random number.
A touch screen is another type of
What will be the output of the program in 16-bit platform (Turbo C under DOS) ?
#include
int main()
{
printf("%d, %d, %d", sizeof(3.0f), sizeof('3'), sizeof(3.0));
return 0;
}
What will be the output of the following C code?
#include
int main()
{
char str[10] = "hello";
char *p = strrchr(str, 'l');
printf("%c\n", *(++p));
}
What will be the output of the following C code?
const char str1[] = "abcdef";
const char str2[] = "fgha";
char *mat;
mat= strpbrk(str1, str2);
if(mat)
printf("First matching character: %c\n", *mat);
else
printf("Character not found");
What will be the output of the following C code?
const char str1[]="ABCDEF1234567";
const char str2[] = "269";
len = strcspn(str1, str2);
printf("First matching character is at %d\n", len + 1);
What will be the output of the program ?
#include
int main()
{
int i=3, *j, k;
j = &i;
printf("%d\n", i**j*i+*j);
return 0;
}
What is the output of this C code?
void main()
{
int x = 97;
int y = sizeof(x++);
printf("x is %d", x);
}
Comment on the output of this C code?
int main()
{
int i, n, a = 4;
scanf("%d", &n);
for (i = 0; i < n> a = a * 2;
}
What is the output of this C code?
int main()
{
int c = 2 ^ 3;
printf("%d\n", c);
}
Total number of questions : 20
Number of answered questions : 0
Number of unanswered questions : 20
Constants in C can be divided into categories ?
Your Answer : (Not Answered)
Correct Answer : C
No answer description available for this question.
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.
typedef int (*PFI)(char *, char *)creates ___________
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 *(*(x()))[2];
typedef int **(*ptrfoo)())[2];
int main()
{
ptrfoo ptr1;
ptr1 = x;
ptr1();
return 0;
}
int *(*(x()))[2]
{
int (*ary)[2] = malloc(sizeof * ary);
return &ary;
}
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
A program P reads in 500 integers in the range [0..100] exepresenting the scores of 500 students. It then prints the frequency of each score above 50. What would be the best way for P to store the frequencies?
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
When does the ArrayIndexOutOfBoundsException occur?
Your Answer : (Not Answered)
Correct Answer : B
ArrayIndexOutOfBoundsException is a run-time exception and the compilation is error-free.
Point out the error, if any in the program.
#include
int main()
{
int i = 1;
switch(i)
{
case 1:
printf("Case1");
break;
case 1*2+4:
printf("Case2");
break;
}
return 0;
}
Your Answer : (Not Answered)
Correct Answer : D
No answer description available for this question.
How many times GeeksQuiz is printed
#include
int main()
{
int i = -5;
while (i <= 5)
{
if (i >= 0)
break;
else
{
i++;
continue;
}
printf("GeeksQuiz");
}
return 0;
}
Your Answer : (Not Answered)
Correct Answer : D
No answer description available for this question.
Which of the following library functions returns the time in UTC (Greenwich mean time) format?
Your Answer : (Not Answered)
Correct Answer : C
No answer description available for this question.
Bitwise can be used to reverse a sign of a number.
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
Bitwise can be used to generate a random number.
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
A touch screen is another type of
Your Answer : (Not Answered)
Correct Answer : C
No answer description available for this question.
What will be the output of the program in 16-bit platform (Turbo C under DOS) ?
#include
int main()
{
printf("%d, %d, %d", sizeof(3.0f), sizeof('3'), sizeof(3.0));
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?
#include
int main()
{
char str[10] = "hello";
char *p = strrchr(str, 'l');
printf("%c\n", *(++p));
}
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
What will be the output of the following C code?
const char str1[] = "abcdef";
const char str2[] = "fgha";
char *mat;
mat= strpbrk(str1, str2);
if(mat)
printf("First matching character: %c\n", *mat);
else
printf("Character not found");
Your Answer : (Not Answered)
Correct Answer : D
The strpbrk() function is used to locate the first occurrence in the string str1 of any character from the string str2.
What will be the output of the following C code?
const char str1[]="ABCDEF1234567";
const char str2[] = "269";
len = strcspn(str1, str2);
printf("First matching character is at %d\n", len + 1);
Your Answer : (Not Answered)
Correct Answer : A
size_t strcspn(const char *str1, const char *str2) is used to calculate the length of the initial segment of str1, which consists entirely of characters not in str2.
What will be the output of the program ?
#include
int main()
{
int i=3, *j, k;
j = &i;
printf("%d\n", i**j*i+*j);
return 0;
}
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 x = 97;
int y = sizeof(x++);
printf("x is %d", x);
}
Your Answer : (Not Answered)
Correct Answer : A
No answer description available for this question.
Comment on the output of this C code?
int main()
{
int i, n, a = 4;
scanf("%d", &n);
for (i = 0; i < n> a = a * 2;
}
Your Answer : (Not Answered)
Correct Answer : B
No answer description available for this question.
What is the output of this C code?
int main()
{
int c = 2 ^ 3;
printf("%d\n", c);
}
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