Basic C MCQ
The continue statement in C language is used to bring the program control to the beginning of the loop. The continue statement skips some lines of code inside the loop and continues with the next iteration.
Syntax:-
While(condition)
{
action -1
continue;
action n;
}
Note:
"Whenever a continue statement is executed, the rest of the statements within the body of the loop are skipped and the conditional expression in the loop is executed."
Q.) W.A.P to print 1 3 4 5.
#include<stdio.h> #include<conio.h> void main() { int i ; for( i=1;i<=5;i++) { if(i==2) { continue; } printf(“%d”,i); } getch(); }
Output
1
3
4
5
3
4
5
For More Details click
Q1. Who is the father of C language?
- Steve Jobs
- James Gosling
- Dennis Ritchie
- Rasmus Lerdorf
Answer:- (c).
Explanations :Dennis Ritchie is the father of C Programming Language. C programming language was developed in 1972 at American Telephone & Telegraph Bell Laboratories of USA.
Explanations :Dennis Ritchie is the father of C Programming Language. C programming language was developed in 1972 at American Telephone & Telegraph Bell Laboratories of USA.
- int number;
- float rate;
- int variable_count;
- int $main;
Answer:- (d).
Explanations :Since only underscore and no other special character is allowed in a variable name, it results in an error.
Explanations :Since only underscore and no other special character is allowed in a variable name, it results in an error.
- LowerCase letters
- UpperCase letters
- CamelCase letters
- None of the mentioned
Answer:- (A).
Explanations :None.
Explanations :None.
- They can contain alphanumeric characters as well as special characters
- It is not an error to declare a variable to be one of the keywords(like goto, static)
- Variable names cannot start with a digit
- Variable can be of any length
Answer:- (C).
Explanations :According to the syntax for C variable name, it cannot start with a digit.
Explanations :According to the syntax for C variable name, it cannot start with a digit.
- int my_num = 100,000;
- int my_num = 100000;
- int my num = 1000;
- int $my_num = 10000;
Answer:- (B).
Explanations :Space, comma and $ cannot be used in a variable name.
Explanations :Space, comma and $ cannot be used in a variable name.
- volatile
- true
- Aggregate datatype
- All of the above
Answer:- (A).
Explanations :volatile is C keyword.
Explanations :volatile is C keyword.
- The basic data type of C
- Qualifier
- Short is the qualifier and int is the basic data type
- All of the mentioned
Answer:- (C).
Explanations :None
Explanations :None
- String str;.
- char *str;
- float str = 3e2;
- Both String str; & float str = 3e2;
Answer:- (A).
Explanations :It is legal in Java, but not in C language.
Explanations :It is legal in Java, but not in C language.
- immutable
- mutable
- const
- volatile
Answer:- (C).
Explanations :const is a keyword constant in C program.
Explanations :const is a keyword constant in C program.
- True or False
- 0 or 1
- 0 if an expression is false and any positive number if an expression is true
- None of the mentioned
Answer:- (B).
Explanations :None.
Explanations :None.
Copyright © 2022 Shineskill Software Pvt. Ltd., All rights reserved.