Kaun Banega C-star (Set 1)

Approved & Edited by ProProfs Editorial Team
At ProProfs Quizzes, our dedicated in-house team of experts takes pride in their work. With a sharp eye for detail, they meticulously review each quiz. This ensures that every quiz, taken by over 100 million users, meets our standards of accuracy, clarity, and engagement.
Learn about Our Editorial Process
| Written by Sanjana
S
Sanjana
Community Contributor
Total Contribution - 1 | Total attempts - 33
Questions: 9 | Attempts: 33

SettingsSettingsSettings
Kaun Banega C-star (Set 1) - Quiz


Questions and Answers
  • 1. 

    1) Which among the below is not a data type associated with C ?

    • A. 

      Int

    • B. 

      Float

    • C. 

      Object

    • D. 

      Void

    Correct Answer
    C. Object
    Explanation
    The correct answer is "object" because in the C programming language, there is no built-in data type called "object". C primarily supports data types like int, float, and void, but not object. Object-oriented programming concepts and the associated object data type are typically found in languages like C++, Java, and C#.

    Rate this question:

  • 2. 

    2) All keywords in C are _____________.

    • A. 

      Lowercase letters

    • B. 

      Uppercase letters

    • C. 

      Camelcase letters

    • D. 

      Both a & b

    Correct Answer
    A. Lowercase letters
    Explanation
    In the C programming language, all keywords are written in lowercase letters. Keywords are predefined words that have special meanings and are reserved for specific purposes in the language. By using lowercase letters for keywords, it helps to distinguish them from user-defined identifiers or variables. Using uppercase or camelcase letters for keywords would result in syntax errors or unexpected behavior in the program. Therefore, the correct answer is lowercase letters.

    Rate this question:

  • 3. 

    3) Which among the following is odd one out?

    • A. 

      Printf()

    • B. 

      Scanf()

    • C. 

      Putchar()

    • D. 

      Fprintf()

    Correct Answer
    B. Scanf()
    Explanation
    The odd one out is scanf() because it is used for input, while the other options (printf(), putchar(), and fprintf()) are used for output.

    Rate this question:

  • 4. 

    4) What is the size of int data type ?

    • A. 

      4 Bytes

    • B. 

      8 Bytes

    • C. 

      Depends on the system/ compiler

    • D. 

      2 Bytes

    Correct Answer
    C. Depends on the system/ compiler
    Explanation
    The size of the int data type depends on the system or compiler being used. Different systems or compilers may allocate different amounts of memory for the int data type. Therefore, the size of int can vary.

    Rate this question:

  • 5. 

    5) Which of the following declarations is not supported in c?

    • A. 

      String str

    • B. 

      Char *str

    • C. 

      Float str=3e2

    • D. 

      Both a and c

    Correct Answer
    A. String str
    Explanation
    The declaration "string str" is not supported in C. In C, the string data type is not built-in, so we cannot directly declare a variable as a string. Instead, we use character arrays to represent strings in C. Therefore, the correct answer is "string str".

    Rate this question:

  • 6. 

    6) For a typical program input is taken using ____________

    • A. 

      Scanf

    • B. 

      Files

    • C. 

      Command line

    • D. 

      All of the above

    Correct Answer
    D. All of the above
    Explanation
    The correct answer is "All of the above" because in a typical program, input can be taken using scanf, files, or command line. The scanf function is commonly used to read input from the user during runtime. Files can be used to read input from external sources such as text files. Command line arguments can also be used to pass input to a program when it is executed. Therefore, all three options are valid methods for taking input in a typical program.

    Rate this question:

  • 7. 

    7) Point out the error (if any) in the following C code? #include<stdio.h> enum hello {     a,b,c; }; main() {     enum hello m;     printf("%d",m); }

    • A. 

      No error

    • B. 

      Error in the statement: a,b,c;

    • C. 

      Error in the statement: enum hello m;

    • D. 

      Error in the statement: printf(“%d”,m);

    Correct Answer
    B. Error in the statement: a,b,c;
    Explanation
    The error in the code is in the statement "a,b,c;". In an enum declaration, each enumerator should be separated by a comma, but the semicolon at the end is not necessary. The correct statement should be "a,b,c".

    Rate this question:

  • 8. 

    8) In C language, FILE is of which data type?

    • A. 

      Int

    • B. 

      Char*

    • C. 

      Struct

    • D. 

      None of the mentioned

    Correct Answer
    C. Struct
    Explanation
    In C language, the FILE is of the struct data type. This data type is used to define the structure of a file, which includes various attributes and information about the file such as its name, location, size, and file operations. The struct data type allows the programmer to organize and access the different elements of the file in a structured manner. Therefore, the correct answer is "struct".

    Rate this question:

  • 9. 

    9) What will be the output of the following code? #include<stdio.h> #define square(x) x*x void main() { int i; i=64/square(4); printf(“%d”,i); }

    • A. 

      4

    • B. 

      64

    • C. 

      16

    • D. 

      None of these

    Correct Answer
    B. 64
    Explanation
    The code defines a macro `square(x)` which calculates the square of a number. In the `main` function, the variable `i` is assigned the value of `64` divided by the result of `square(4)`. Since the macro expands to `4*4`, the expression becomes `64/4*4`, which follows the left-to-right evaluation order. Therefore, the division is performed first, resulting in `16*4`, and the final value of `i` is `64`.

    Rate this question:

Back to Top Back to top
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.