Online Test for C
- Which of the following is NOT a valid Integer Constant?
3+343-76510,000
- Find Error/Output in follwing code:
#include <stdio.h>
main( ) {
int i;
for ( i=0; i<5; i++ ) {
int i = 10;
printf ( " %d", i );
i++;
}
return 0;
}
10 11 12 13 14
10 10 10 10 10
0 1 2 3 4
Compilation error
- Every C Program must have one function called?
switch()main()struct()for()
- Which of these assignments is invalid?
short s = 48;float f = 4.3;double d = 4.3;int I = `1`;
- C variable cannot start with
An alphabetA numberA special symbol other than underscoreboth (b) and (c)
- Which is the right way to declare constant in C?
int constant var =10;int const var = 10;const int var = 10;B & C Both
- What does the following declaration mean? int (*ptr) [10];
ptr is an array of pointers of 10 integers.ptr is a pointer to an array of 10 integers.ptr is an array of 10 integers.None of the above
- What is right way to Initialization array?
int num[6] = { 2, 4, 12, 5, 45, 5 } ;int n{} = { 2, 4, 12, 5, 45, 5 } ;int n{6} = { 2, 4, 12 } ;int n(6) = { 2, 4, 12, 5, 45, 5 } ;
- Find Error/Output in follwing code:
main() {
int i = 2, *j;
j = &i;
printf("%d", i**j*i+*j);
}
Syntax error due to Invalid expression in printf
Print junk value
16
10
- A file opened for writing already exists its contents would be overwritten.
TrueFalse
Also Exercise
Post Your Question
Social Sharing
Search
Articles
Recently Added Jobs
Rajasthan High Court - Jodhpur Recruitment 2017 for Civil Judges
Last Date: 21 December, 2017
Last Date: 21 December, 2017
WBSEDCL Recruitment - 2017 for Office Executive
Last Date: 16 May, 2017
Last Date: 16 May, 2017
RECRUITMENT OF PROBATIONARY OFFICERS IN STATE BANK OF INDIA
Last Date: 06 March, 2017
Last Date: 06 March, 2017
UPSC Combined Medical Services Examination 2015
Last Date: 10 April, 2015
Last Date: 10 April, 2015
UPSC Engineering Services Examination 2015
Last Date: 10 April, 2015
Last Date: 10 April, 2015