Online Test for C
- What is the purpose of getc()?
read a character from STDINread a character from a fileread all fileread file randomly
- Which of the following is NOT a valid Character Constant?
’P’’2’’PQ’’#’
- How to make an infinity loop in C?
loop: ..... goto loop;for(;;) { }while(1) { }All of the above
- Recursive functions are executed in a?
First In First Out OrderLoad BalancingParallel FashionLast In First Out Order
- What is constant?
Constants have fixed values that do not change during the execution of a programConstants have fixed values that change during the execution of a programConstants have unknown values that may be change during the execution of a programNone of the above
- Find Error/Output in follwing code:
void fn()
{
static int i = 10;
printf("%d ", ++i);
}
int main()
{
fn();
fn();
}
10 10
11 11
11 12
12 12
- Find Error/Output in follwing code:
int main() {
int i=0;
for(;;)
printf("%d",i);
return 0;
}
0 times
Infinite times
10 times
1 times
- Which of the following storage classes have global visibility in C?
AutoStaticExternRegister
- What is function?
Function is a block of statements that perform some specific task.Function is the fundamental modular unit. A function is usually designed to perform a specific task.Function is a block of code that performs a specific task. It has a name and it is reusableAll the above
- Find Error/Output in follwing code:
int main ()
{
int a[4] = { 25, 16 };
printf ("%d %d", a[0] & a[1], a[1] | a[2]);
}
Syntax error because of invalid operator symbol
25 16
16 16
Syntax error because of invalid array initialization
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