CSE MCQs :: C-MCQs
-
What is the output of this C code?
void foo(const int *);
int main()
{
const int i = 10;
printf("%d ", i);
foo(&i);
printf("%d", i);
}
void foo(const int *i)
{
*i = 20;
} -
Comment on the output of this C code?
int main()
{
const int i = 10;
int *ptr = &i;
*ptr = 20;
printf("%d\n", i);
return 0;
} -
Does this compile without error?
int main()
{
for (int k = 0; k < 10; k++);
return 0;
} -
Does this compile without error?
int main()
{
int k;
{
int k;
for (k = 0; k < 10; k++);
}
} - Which of the following declaration is not supported by C?
-
Which of the following format identifier can never be used for the variable var?
int main()
{
char *var = "Advanced Training in C by AllIndiaExams.com";
} - Which keyword is used to prevent any changes in the variable within a C program?
- Which of the following is not a pointer declaration?
-
What is the output of this C code?
void main()
{
int k = 4;
float k = 4;
printf("%d", k)
} - Which is false ?