C Programming MCQ's - Set 2

  • ISO/IEC 9899
Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Deepchawla
D
Deepchawla
Community Contributor
Quizzes Created: 2 | Total Attempts: 2,654
| Attempts: 711 | Questions: 10
Please wait...
Question 1 / 10
0 %
0/100
Score 0/100
1. Which data type is not a primary data type

Explanation

The given options are int, array, float, and char. Out of these options, array is not a primary data type. In programming, a primary data type refers to the basic data types that are built-in and provided by the programming language itself. These primary data types include int, float, and char. However, array is not a primary data type as it is a composite data type that allows storing multiple values of the same data type.

Submit
Please wait...
About This Quiz
C Programming MCQs - Set 2 - Quiz

This quiz provides you the basic multiple choice questions on C constants.

Personalize your quiz and earn a certificate with your name on it!
2. The modifier which is used to declare a variable as constant

Explanation

The correct answer is "const". The const modifier is used to declare a variable as constant, meaning its value cannot be changed once it has been assigned.

Submit
3. How much memory is required to store a value of type double ?

Explanation

A value of type double requires 8 bytes of memory. The double data type is used to store decimal numbers with a higher precision compared to the float data type. It occupies 64 bits of memory, allowing it to hold a wider range of values with greater accuracy.

Submit
4. Character Set of C language contains ?

Explanation

The character set of the C language includes alphabets, digits, and special symbols. This means that any combination of letters, numbers, and special characters can be used in C programming. Therefore, the correct answer is "All of these."

Submit
5. A variable name can have ?

Explanation

A variable name can have an underscore because it is a valid character in most programming languages to separate words within a variable name. It is commonly used to improve readability and make the variable name more descriptive. Using an underscore can make the variable name more meaningful and easier to understand, especially when the variable name consists of multiple words.

Submit
6. In C language , one of the following is not a valid data type

Explanation

In C language, long is a valid data type. It is used to store larger integer values than the int data type. The long data type occupies more memory space compared to the int data type. Other valid data types in C language are float, double, and char. Float and double are used to store floating-point numbers, while char is used to store single characters.

Submit
7. Which is the valid string data

Explanation

The valid string data in this case is "A" because it is enclosed within double quotation marks. The other options, 'A' and A, are not valid string data as they are not enclosed within quotation marks. The option "None of these" is not a valid string data either as it does not represent any specific string value.

Submit
8. Which of the format string is not valid ?

Explanation

The format string "%lc" is not valid because the "%lc" format specifier is used for wide characters in some programming languages, such as C, but it is not a valid format specifier in most common programming languages like C++, Java, or Python. The correct format specifier for a wide character is "%lc" or "%C".

Submit
9. A variable of type unsigned int can have a value in the range of ?

Explanation

A variable of type unsigned int can have a value in the range of 0 to 65535. Unsigned int is a data type that only allows positive integers or zero, and it can store values up to 2^16 - 1, which is 65535. The range starts from 0 because it does not allow negative values.

Submit
10. The format string %lf is used for ?

Explanation

The format string %lf is used for long double because the 'l' in %lf stands for "long" and 'f' stands for "float". Therefore, %lf is used to format and print long double values.

Submit
View My Results

Quiz Review Timeline (Updated): Feb 17, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Feb 17, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Mar 22, 2012
    Quiz Created by
    Deepchawla
Cancel
  • All
    All (10)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which data type is not a primary data type
The modifier which is used to declare a variable as constant
How much memory is required to store a value of type double ?
Character Set of C language contains ?
A variable name can have ?
In C language , one of the following is not a valid data type
Which is the valid string data
Which of the format string is not valid ?
A variable of type unsigned int can have a value in the range of ?
The format string %lf is used for ?
Alert!

Advertisement