You can prepare effectively for Grade 6 C Programming for Beginners with this dedicated MCQ Practice Test (available with solutions) on the important topic of "Test: C Function Declaration". These 10 questions have been designed by the experts with the latest curriculum of Grade 6 2026, to help you master the concept.
Test Highlights:
Sign up on EduRev for free to attempt this test and track your preparation progress.
What will be the output of the following C code?
#include <stdio.h>
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;
}
Detailed Solution: Question 1
What will be the output of the following C code?
#include <stdio.h>
int main()
{
const int i = 10;
int *ptr = &i;
*ptr = 20;
printf("%d\n", i);
return 0;
}
Detailed Solution: Question 2
What will be the output of the following C code?
#include <stdio.h>
int main()
{
j = 10;
printf("%d\n", j++);
return 0;
}
Detailed Solution: Question 3
Will the following C code compile without any error?
#include <stdio.h>
int main()
{
for (int k = 0; k < 10; k++);
return 0;
}
Detailed Solution: Question 4
Will the following C code compile without any error?
#include <stdio.h>
int main()
{
int k;
{
int k;
for (k = 0; k < 10; k++);
}
}
Detailed Solution: Question 5
Which of the following declaration is not supported by C?
Detailed Solution: Question 6
Which of the following format identifier can never be used for the variable var?
#include <stdio.h>
int main()
{
char *var = "Advanced Training in C by Sanfoundry.com";
}
Detailed Solution: Question 7
Detailed Solution: Question 8
Which keyword is used to prevent any changes in the variable within a C program?
Detailed Solution: Question 9
Which of the following is not a pointer declaration?
Detailed Solution: Question 10
10 videos|14 docs|15 tests |