C Language Exam: Practice Quiz! Trivia

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Sunil Singhal
S
Sunil Singhal
Community Contributor
Quizzes Created: 4 | Total Attempts: 18,811
Questions: 50 | Attempts: 1,688

SettingsSettingsSettings
C Language Exam: Practice Quiz! Trivia - Quiz

.


Questions and Answers
  • 1. 

    How would you copy the name “Hello” to a character array (i.e. string) declared as char str[10];

    • A.

      Strcpy( str, “Hello” );

    • B.

      Strcat(str,“Hello”);

    • C.

      Printf( str, “Hello” );

    • D.

      Str = “Hello”;

    Correct Answer
    A. Strcpy( str, “Hello” );
    Explanation
    The correct answer is strcpy( str, "Hello" );. This function is used to copy a string from one location to another. In this case, it copies the string "Hello" to the character array str. The other options are incorrect. strcat(str, "Hello") would concatenate the string "Hello" to the existing string in str. printf( str, "Hello" ) is not a valid function call as printf is used for printing formatted output. str = "Hello" is also incorrect as you cannot assign a string directly to a character array.

    Rate this question:

  • 2. 

    count=0; for ( I=0;I<=10; I++) {if(I%2==0) count++; }printf(“%d”, count); Pick out the correct value for count

    • A.

      6

    • B.

      3

    • C.

      4

    • D.

      5

    Correct Answer
    A. 6
    Explanation
    The code initializes a variable "count" to 0. It then runs a loop from 0 to 10 (inclusive) and checks if each value of "I" is divisible by 2 (i.e., even). If "I" is even, it increments the "count" variable by 1. Finally, it prints the value of "count". Since there are 6 even numbers (0, 2, 4, 6, 8, 10) in the range, the correct value for "count" is 6.

    Rate this question:

  • 3. 

    The value within the [] brackets in an array declaration specifies

    • A.

      Value of the array element

    • B.

      Subscript value

    • C.

      Address value

    • D.

      Size of an array

    Correct Answer
    D. Size of an array
    Explanation
    The value within the [] brackets in an array declaration specifies the size of the array. It determines the number of elements that can be stored in the array.

    Rate this question:

  • 4. 

    Compute the result of the following expression in ‘C’. A=3*4/5+10/5+8-1+7/8

    • A.

      11

    • B.

      10

    • C.

      12

    • D.

      9

    Correct Answer
    A. 11
    Explanation
    The expression A=3*4/5+10/5+8-1+7/8 can be simplified as follows:
    - First, we perform the multiplication and division operations from left to right: 3*4/5 = 12/5
    - Next, we perform the addition and subtraction operations from left to right: 12/5 + 10/5 + 8 - 1 + 7/8 = 2.4 + 2 + 8 - 1 + 0.875
    - Finally, we add up all the values: 2.4 + 2 + 8 - 1 + 0.875 = 11.275
    Since the result is a decimal number, we round it down to the nearest whole number, which is 11.
    Therefore, the correct answer is 11.

    Rate this question:

  • 5. 

    Dynamic memory allocation in array results in

    • A.

      Allocation of memory at debugging time

    • B.

      Allocation of memory at file saving time

    • C.

      Allocation of memory at compile time

    • D.

      Allocation of memory at runtime

    Correct Answer
    D. Allocation of memory at runtime
    Explanation
    Dynamic memory allocation in an array refers to the process of allocating memory for the array elements during the runtime of a program. This means that the memory for the array is allocated dynamically, based on the program's needs, rather than at compile time or any other specific time. The advantage of dynamic memory allocation is that it allows for flexibility in memory usage, as the size of the array can be determined and adjusted during runtime.

    Rate this question:

  • 6. 

    What is the output of the following module sum=0; I=0; do{ sum+=I; I++; }while(I<=5); printf(“%d”, sum);

    • A.

      28

    • B.

      10

    • C.

      15

    • D.

      21

    Correct Answer
    C. 15
    Explanation
    The given module calculates the sum of numbers from 1 to 5 using a do-while loop. The variable 'sum' is initialized to 0 and 'I' is initialized to 0. Inside the loop, 'sum' is incremented by the value of 'I' and 'I' is incremented by 1. This process continues until 'I' becomes greater than 5. Finally, the value of 'sum' is printed using the printf statement. In this case, the final value of 'sum' would be 15, which is the correct answer.

    Rate this question:

  • 7. 

    Which of the follwing is a string

    • A.

      ‘abcd’

    • B.

      “abcd”

    • C.

      Abcd

    • D.

      ‘abcd”

    Correct Answer
    B. “abcd”
    Explanation
    The correct answer is "abcd" because it is enclosed in double quotation marks, which is the correct syntax for representing a string in many programming languages. The other options either lack the quotation marks or have mismatched quotation marks, making them invalid representations of a string.

    Rate this question:

  • 8. 

    Give the output of the following program: #include < stdio.h > main() {int I=1; while (I < 5) {printf(“%d”, I); }} /* End of Main */

    • A.

      Print the value of I as 1

    • B.

      Warning for no return type for main ( )

    • C.

      Infinite loop

    • D.

      Prints the value of I as11111

    Correct Answer
    C. Infinite loop
    Explanation
    The given program contains a while loop that will continue executing as long as the condition "I < 5" is true. However, there is no statement inside the loop that modifies the value of I, so it will always remain 1. Therefore, the condition will always be true and the loop will run indefinitely, resulting in an infinite loop.

    Rate this question:

  • 9. 

    What will happen if you try to put so many values into an array during the initalization such that its size is  exceeded

    • A.

      Error message from the compiler

    • B.

      Possible system malfunction

    • C.

      Last element data may be overwritten

    • D.

      Nothing

    Correct Answer
    B. Possible system malfunction
    Explanation
    If you try to put too many values into an array during initialization and exceed its size, it can lead to a possible system malfunction. This is because the array is allocated a fixed amount of memory based on its size during initialization. When you try to store more values than the allocated memory can hold, it can cause memory corruption and potentially crash the system or cause unexpected behavior.

    Rate this question:

  • 10. 

    Which of the following statements would read a single character from the keyboard and place the result in a character variable ‘ch’ defined as: char ch;

    • A.

      Ch = getch( );

    • B.

      Printf( “%c”, ch );

    • C.

      While(!kbhit)

    • D.

      Getkeyb ( ch );

    Correct Answer
    A. Ch = getch( );
    Explanation
    The correct answer is "ch = getch( );". This statement uses the getch() function to read a single character from the keyboard and assigns the result to the character variable 'ch'.

    Rate this question:

  • 11. 

    consider the array definition int num [10] = { 3 ,3 ,3 }; pick the correct answers

    • A.

      This is syntactically wrong

    • B.

      The value of num[8] is 3

    • C.

      This is invalid if it comes within a function

    • D.

      The value of num[2] is 3

    Correct Answer
    D. The value of num[2] is 3
    Explanation
    The given array definition initializes an array called "num" with a size of 10 and assigns the first three elements with the value 3. Since array indices start from 0, the value of num[2] refers to the third element in the array, which is indeed 3. Therefore, the statement "the value of num[2] is 3" is correct.

    Rate this question:

  • 12. 

    Output of the below program #include<stdio.h> main() {int a,b=0; int c[10]={1,2,3,4,5,6,7,8,9,0 }; for(a=0;a<10;++a) b+=c[a]; printf(“%d”,b); }

    • A.

      1 3 6 10 15 21 28 32 45 45

    • B.

      55

    • C.

      45

    • D.

      0

    Correct Answer
    C. 45
    Explanation
    The program first initializes variables a and b, and an array c with 10 elements. It then enters a for loop that iterates from 0 to 9. Inside the loop, it adds the value of each element in array c to the variable b. After the loop, it prints the value of b, which is the sum of all elements in array c. Therefore, the output of the program will be 45.

    Rate this question:

  • 13. 

    The maximum number of dimension an array can have in C language is

    • A.

      4

    • B.

      5

    • C.

      Compiler dependent

    • D.

      3

    Correct Answer
    C. Compiler dependent
    Explanation
    The maximum number of dimensions an array can have in C language is not fixed and depends on the compiler being used. Different compilers may have different limits on the number of dimensions allowed for an array. Therefore, the correct answer is "compiler dependent".

    Rate this question:

  • 14. 

    What is the result of the expression ( 10/3 )*3+5%3 ?

    • A.

      10

    • B.

      11

    • C.

      8

    • D.

      1

    Correct Answer
    B. 11
    Explanation
    The expression (10/3) evaluates to 3.3333. Multiplying this by 3 gives us 9.9999. The modulus operator (%) calculates the remainder of dividing 5 by 3, which is 2. Adding 9.9999 and 2 gives us 11. Therefore, the result of the expression is 11.

    Rate this question:

  • 15. 

    Array subscripts in ‘C’ always start at

    • A.

      0

    • B.

      Compiler dependent

    • C.

      1

    • D.

      -1

    Correct Answer
    A. 0
    Explanation
    In the programming language 'C', array subscripts always start at 0. This means that the first element of an array is accessed using the subscript 0, the second element with the subscript 1, and so on. This is a fundamental concept in 'C' and many other programming languages, where arrays are typically implemented as contiguous blocks of memory. Starting the subscripts at 0 allows for efficient memory access and indexing calculations.

    Rate this question:

  • 16. 

    The statements that prints out the character set from A-Z is, where a is an integer variable

    • A.

      For(a=‘A’; a

    • B.

      For(a=‘A’; a

    • C.

      For(a=‘a’; a

    • D.

      For(a=’A’ a

    Correct Answer
    D. For(a=’A’ a
    Explanation
    The correct answer is "for(a='A' a". This statement initializes the variable "a" with the character 'A' and then loops while "a" is less than or equal to the character set's last character, which is 'Z'. Therefore, it will print out the character set from A to Z. The other statements either have syntax errors or do not cover the entire character set.

    Rate this question:

  • 17. 

    The amount of storage required for holding elements of the array depends on

    • A.

      Data type

    • B.

      Datatype and size

    • C.

      Run-time requirement

    • D.

      Size

    Correct Answer
    B. Datatype and size
    Explanation
    The amount of storage required for holding elements of the array depends on both the data type and the size. Different data types have different sizes in memory, so the storage needed will vary based on the data type used. Additionally, the size of the array, which determines the number of elements it can hold, also affects the amount of storage required. Therefore, both the data type and the size of the array are factors that determine the amount of storage needed.

    Rate this question:

  • 18. 

    If we don’t initialize a static array, what will be the elements set to:

    • A.

      Character constant

    • B.

      A floating point number

    • C.

      0

    • D.

      An undetermined value

    Correct Answer
    C. 0
    Explanation
    If we don't initialize a static array, the elements will be set to 0. This means that each element in the array will have a value of 0 by default.

    Rate this question:

  • 19. 

    What is wrong with the following program main() { char m1[9]= “message1”; char m2[9]=“message2”; m2=m1; printf(“msg is %s”,m2); }

    • A.

      Char array cannot be printed directly using printf

    • B.

      Array is not a left value and so cannot be assigned to

    • C.

      Program compiles without error, but prints an unpredictable value

    • D.

      Array cannot be initialized as above

    Correct Answer
    B. Array is not a left value and so cannot be assigned to
    Explanation
    The program is attempting to assign the value of m1 to m2, but arrays cannot be assigned to in this way. Arrays are not considered left values, meaning they cannot be assigned to like variables. This causes a compilation error in the program.

    Rate this question:

  • 20. 

    The total memory required for an array

    • A.

      Sizeof (datatype) * 2

    • B.

      Size of (datatype) * size of used array elements

    • C.

      Sizeof (datatype) * sizeof array

    • D.

      Size of (array) * datatype

    Correct Answer
    C. Sizeof (datatype) * sizeof array
    Explanation
    The correct answer is "sizeof (datatype) * sizeof array". This is because the sizeof operator returns the size in bytes of the datatype, and multiplying it by the sizeof array gives the total memory required for the array.

    Rate this question:

  • 21. 

    How many bytes will be allotted for the declaration int num[4] [3]

    • A.

      6 bytes

    • B.

      24 bytes

    • C.

      12 bytes

    • D.

      48 bytes

    Correct Answer
    B. 24 bytes
    Explanation
    The declaration "int num[4][3]" indicates a two-dimensional array with 4 rows and 3 columns. Since each element in the array is of type "int", which typically takes up 4 bytes of memory, the total memory allocated can be calculated by multiplying the number of rows by the number of columns by the size of each element. In this case, 4 rows multiplied by 3 columns multiplied by 4 bytes gives us a total of 24 bytes.

    Rate this question:

  • 22. 

    If statement is a —————statement

    • A.

      Loop construct

    • B.

      Two way decision

    • C.

      Multiway decision

    • D.

      One-way decision

    Correct Answer
    B. Two way decision
    Explanation
    A two-way decision statement is a type of statement that allows the program to make a decision between two possible outcomes. It typically uses a conditional expression to evaluate a condition and then executes different blocks of code based on whether the condition is true or false. This type of statement is commonly used in programming to implement if-else constructs, where one block of code is executed if the condition is true and another block is executed if the condition is false.

    Rate this question:

  • 23. 

    What is the output of the following program main() {static int y; printf (“%d\n”, y); }

    • A.

      0

    • B.

      Run-time error

    • C.

      Undefined

    • D.

      Compilation error

    Correct Answer
    A. 0
    Explanation
    The program declares a static variable "y" but does not assign any value to it. In C, static variables are automatically initialized to zero. Therefore, when the program prints the value of "y", it will output 0.

    Rate this question:

  • 24. 

    printf (“\ “ well done\” ”); what will be the output of this statement

    • A.

      \“well done \”

    • B.

      Well done

    • C.

      “ well done”

    • D.

      \ well done \

    Correct Answer
    C. “ well done”
    Explanation
    The correct answer is " well done". This is because the backslashes (\) before and after the quotation marks (\") are escape characters, which indicate that the quotation marks should be treated as part of the string and not as string delimiters. Therefore, the output will include the quotation marks and the space before and after the words "well done".

    Rate this question:

  • 25. 

    Which of the following is not correct

    • A.

      While loop is executed atleast once

    • B.

      Do . while loop is executed at least once

    • C.

      While loop is executed only if the condition is true

    • D.

      Dowhile loop is ececuted only if the condition is true

    Correct Answer
    A. While loop is executed atleast once
    Explanation
    The statement "while loop is executed at least once" is incorrect. A while loop is only executed if the condition is true. If the condition is initially false, the loop will not be executed at all.

    Rate this question:

  • 26. 

    The global variable can be declared

    • A.

      After main

    • B.

      After block

    • C.

      Before main

    • D.

      Within block

    Correct Answer
    C. Before main
    Explanation
    Global variables can be declared before the main function in C programming. This means that the variable can be declared outside of any function, including the main function, and can be accessed by any function within the program. This allows the variable to have a global scope and be accessible throughout the entire program. By declaring the variable before the main function, it ensures that the variable is available for use by any function that may need it.

    Rate this question:

  • 27. 

    How many while statements are possible in do.... While loop?

    • A.

      2

    • B.

      3

    • C.

      Any number

    • D.

      1

    Correct Answer
    C. Any number
    Explanation
    In a do...while loop, the condition is checked at the end of each iteration. This means that the loop will continue executing as long as the condition is true. Since the condition can be any boolean expression, there is no limit to the number of while statements that can be used in a do...while loop. Therefore, the correct answer is "any number".

    Rate this question:

  • 28. 

    The storage area for register variables

    • A.

      Cache

    • B.

      Memory

    • C.

      Processor registers

    • D.

      Virtual memory

    Correct Answer
    C. Processor registers
    Explanation
    Processor registers are a small set of high-speed memory locations within the CPU that are used to store data that needs to be accessed quickly. Register variables are variables that are stored in these processor registers rather than in main memory. Storing variables in processor registers can result in faster access times compared to storing them in cache or main memory. Therefore, the correct answer is processor registers.

    Rate this question:

  • 29. 

    Which of the following statements is false

    • A.

      The initialization and increment parts of a for statement can be empty

    • B.

      The body of do-while statement can be empty

    • C.

      The expression in the condition part of a for statement can be empty

    • D.

      The initialization part of a for statement cannot have more than one initialization

    Correct Answer
    D. The initialization part of a for statement cannot have more than one initialization
    Explanation
    The initialization part of a for statement can have more than one initialization. In a for statement, the initialization part allows multiple variables to be initialized. This is done by separating the initializations with commas. Therefore, the statement "The initialization part of a for statement cannot have more than one initialization" is false.

    Rate this question:

  • 30. 

    Consider the segment If(1) printf(“yes”); else printf(“no”); what will be the output

    • A.

      No

    • B.

      Unpredictable

    • C.

      Yes

    • D.

      Error

    Correct Answer
    C. Yes
    Explanation
    The output will be "yes" because the condition in the if statement (1) is true. Therefore, the code inside the if block will be executed, which is to print "yes" using the printf function.

    Rate this question:

  • 31. 

    In switch statement

    • A.

      More than one default allowesd

    • B.

      Default case, if used, should be the last case

    • C.

      Default case, if used, can be placed anywhere

    • D.

      Default case must be present

    Correct Answer
    C. Default case, if used, can be placed anywhere
    Explanation
    The correct answer is that the default case, if used, can be placed anywhere in a switch statement. Unlike other cases, the default case does not require a specific position and can be placed anywhere within the switch statement. This allows for flexibility in the code structure and logic, as the default case can be positioned based on the specific requirements of the program.

    Rate this question:

  • 32. 

    The minimum number of times the for loop is executed is

    • A.

      0

    • B.

      Cannot be predicted

    • C.

      1

    • D.

      2

    Correct Answer
    A. 0
    Explanation
    The for loop is a control structure that executes a block of code repeatedly until a certain condition is met. In this case, the minimum number of times the for loop is executed is 0. This means that the loop will not execute at all if the condition is not met initially. Therefore, the correct answer is 0.

    Rate this question:

  • 33. 

    Identify the loop construct:

    • A.

      If-else

    • B.

      Goto

    • C.

      While

    • D.

      Switch-case

    Correct Answer
    C. While
    Explanation
    The correct answer is "while". The while loop construct is used to repeatedly execute a block of code as long as a certain condition is true. It first checks the condition and if it is true, the code inside the loop is executed. Once the code is executed, the condition is checked again and if it is still true, the code is executed again. This process continues until the condition becomes false.

    Rate this question:

  • 34. 

    Which of the following is not a storage class

    • A.

      External

    • B.

      Automatic

    • C.

      Register

    • D.

      Define

    Correct Answer
    D. Define
    Explanation
    The storage class "define" does not exist in the C programming language. The other three options, external, automatic, and register, are all valid storage classes in C. The "define" option is most likely included in the question to confuse the reader, as it is a common keyword used in preprocessor directives, but it is not a storage class.

    Rate this question:

  • 35. 

    Which of the following is a correct way of defining a symbolic constant pie in C

    • A.

      # define pie = 22/7

    • B.

      #define pie 22/7

    • C.

      #define pie= 3.142

    • D.

      # Define pie 22/7

    Correct Answer
    B. #define pie 22/7
    Explanation
    The correct way of defining a symbolic constant pie in C is by using the #define directive followed by the constant name (pie) and its value (22/7). This creates a macro that replaces every occurrence of "pie" in the code with the value 22/7.

    Rate this question:

  • 36. 

    main() { char name[5]; scanf(“%s”,name); printf(“%s”, name); }if Program is the given as input, what will be the o/p of the program;

    • A.

      Progr

    • B.

      Prog

    • C.

      Program

    • D.

      Runtime error

    Correct Answer
    B. Prog
    Explanation
    The program declares a character array named "name" with a size of 5. It then scans for input and stores it in the "name" array. Since the input is "Program", which is 7 characters long, it will only store the first 4 characters ("Prog") in the "name" array. Finally, it prints the contents of the "name" array, which is "Prog". Therefore, the output of the program will be "Prog".

    Rate this question:

  • 37. 

    What will be the output of the following program? #include<stdio.h> int main() { char numbers[5][6] = {"Zero","One","Two","Three","Four"}; printf("%s is %c",&numbers[4][0],numbers[0][0]); return 0; }

    • A.

      Four is Z

    • B.

      Three is Z

    • C.

      Compiler error

    • D.

      Two is Z

    Correct Answer
    A. Four is Z
    Explanation
    The program creates a 2-dimensional character array called "numbers" with 5 rows and 6 columns. Each row represents a word. In the printf statement, it prints the character at the first index of the 5th row of the "numbers" array, which is 'F', and the character at the first index of the 1st row of the "numbers" array, which is 'Z'. Therefore, the output will be "Four is Z".

    Rate this question:

  • 38. 

    Which one of the following is an example of storage class in C?

    • A.

      Int and float

    • B.

      Extern

    • C.

      Both 1 & 2

    • D.

      Neither 1 nor 2

    Correct Answer
    B. Extern
    Explanation
    The correct answer is "extern" because it is a storage class in the C programming language. The "extern" keyword is used to declare a variable that is defined in another file, allowing the variable to be accessed by multiple files in a program. This storage class is commonly used when creating global variables that need to be shared across multiple source files.

    Rate this question:

  • 39. 

    What will be the output of the following program? #include<stdio.h> int main() { int a = 1, b = 2, c = 3; printf("The value of a is %d", ++a); func(); printf(" The value of a is %d", ++a); return 0; } void func() { int a = 10; return 0; }

    • A.

      The value of a is 2 The value of a is 2

    • B.

      The value of a is 2 The value of a is 3

    • C.

      The value of a is 1 The value of a is 10

    • D.

      Compiler error

    Correct Answer
    B. The value of a is 2 The value of a is 3
    Explanation
    The output of the program will be "The value of a is 2 The value of a is 3". This is because the value of a is incremented by 1 using the pre-increment operator (++a) before the first printf statement. Then the function func() is called, but it does not affect the value of a. Finally, after the function call, the value of a is again incremented by 1 before the second printf statement.

    Rate this question:

  • 40. 

    What  is the output of the below program? #include<stdio.h> int main() { printf("%c", "abcdefgh"[6]); return 0; }

    • A.

      G

    • B.

      E

    • C.

      F

    • D.

      Compiler Error

    Correct Answer
    A. G
    Explanation
    The program is using array indexing to access the character at index 6 of the string "abcdefgh". Since array indexing starts at 0, the character at index 6 is 'g'. Therefore, the output of the program will be 'g'.

    Rate this question:

  • 41. 

    What will be the output of the following program? #include<stdio.h> #define putchar(c) printf("%c",c) int  main() { char s='c'; putchar (s); return 0; }

    • A.

      99

    • B.

      Compiler Error

    • C.

      Runtime Error

    • D.

      C

    Correct Answer
    D. C
    Explanation
    The program defines a macro called putchar which takes a character as an argument and prints it using the printf function. In the main function, a character variable s is assigned the value 'c'. Then, the putchar macro is called with the argument s, which is 'c'. As a result, the character 'c' is printed. Therefore, the output of the program will be c.

    Rate this question:

  • 42. 

    What will be the output of the following program? #include<stdio.h> enum {TRUE, FALSE}; int main() { int i=1; do{ printf("%d\t",i); i++; if(i > 5) break; } while(TRUE); return 0; }

    • A.

      1 2 3 4 5

    • B.

      It prints an infinite loop of numbers

    • C.

      1 2 3 4

    • D.

      1

    Correct Answer
    D. 1
    Explanation
    The program uses a do-while loop to print the value of the variable i and increments it by 1 each time. It also includes a condition that if i becomes greater than 5, the loop will break. Since the condition of the loop is set to TRUE, the loop will continue indefinitely until it is manually broken. In this case, the loop will print the numbers 1, 2, 3, 4, and 5 before breaking out of the loop. Therefore, the output of the program will be "1 2 3 4 5".

    Rate this question:

  • 43. 

    C language has been developed by?

    • A.

      Ken Thompson

    • B.

      Dennis Ritchie

    • C.

      Peter Norton

    • D.

      Martin Richards

    Correct Answer
    B. Dennis Ritchie
    Explanation
    Dennis Ritchie is the correct answer because he is one of the main developers of the C programming language. Along with Ken Thompson, Ritchie created C at Bell Labs in the early 1970s. C became widely used and influential in the field of computer programming, serving as the foundation for many other programming languages. Ritchie's contributions to the development of C and his work on Unix have had a lasting impact on the field of computer science.

    Rate this question:

  • 44. 

    C can be used on?

    • A.

      Only MS-DOS

    • B.

      Only Linux

    • C.

      Only window

    • D.

      All of the above

    Correct Answer
    D. All of the above
    Explanation
    The correct answer is "All of the above" because C is a programming language that can be used on multiple operating systems, including MS-DOS, Linux, and Windows. It is a versatile language that is not limited to a specific platform, allowing developers to write code that can run on different operating systems without major modifications.

    Rate this question:

  • 45. 

    C programs are converted into the machine language with the help of?

    • A.

      An editor

    • B.

      Compiler

    • C.

      An operating system

    • D.

      None of the above

    Correct Answer
    B. Compiler
    Explanation
    C programs are converted into machine language with the help of a compiler. A compiler is a software tool that translates the entire C program into machine code that can be directly executed by the computer's processor. It analyzes the source code, checks for errors, and generates the corresponding machine code instructions. This process is known as compilation and is essential for the execution of C programs on a computer.

    Rate this question:

  • 46. 

    The real constant in C can be expressed in which of the following forms?

    • A.

      Fractional form only

    • B.

      Exponetial form only

    • C.

      ASCII form only

    • D.

      Both Fractional and Exponetial

    Correct Answer
    D. Both Fractional and Exponetial
    Explanation
    The real constant in C can be expressed in both fractional and exponential forms. This means that a real constant in C can be represented as a fraction or in scientific notation with an exponent. For example, a real constant can be written as 0.5 or as 5e-1. Both forms are valid ways to express a real constant in C.

    Rate this question:

  • 47. 

    A character variable can at a time score?

    • A.

      1 character

    • B.

      8 characters

    • C.

      254 characters

    • D.

      None of the above

    Correct Answer
    A. 1 character
    Explanation
    A character variable can at a time store only one character. This is because a character variable is designed to hold a single character value. It cannot store multiple characters or a string of characters. Therefore, the correct answer is 1 character.

    Rate this question:

  • 48. 

    The maximum value that an integer constant can have is?

    • A.

      -32767

    • B.

      32767

    • C.

      1.7014e+38

    • D.

      -1.7014e+38

    Correct Answer
    B. 32767
    Explanation
    The maximum value that an integer constant can have is 32767. This is because in most programming languages, integers are typically represented using a fixed number of bits, such as 16 bits. With 16 bits, the maximum value that can be represented is 2^(16-1) - 1, which equals 32767.

    Rate this question:

  • 49. 

    A-C variable cannot start with?

    • A.

      An alphabet

    • B.

      A number

    • C.

      A special symbol other than underscore

    • D.

      Both (2) and (3)

    Correct Answer
    D. Both (2) and (3)
    Explanation
    The correct answer is both (2) and (3). This means that a variable in programming cannot start with a number or a special symbol other than an underscore. Variables must start with an alphabet character. This is because programming languages have specific rules for naming variables, and starting with a number or a special symbol can cause syntax errors or confusion in the code.

    Rate this question:

  • 50. 

    Linux was developed mainly using C language. 

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    Linux was developed mainly using the C language because C is a high-level programming language that allows for efficient and low-level programming. It provides direct access to memory and hardware, making it suitable for developing an operating system like Linux. Additionally, C is portable and can be easily adapted to different hardware architectures, which is crucial for an operating system that needs to run on various devices. Therefore, it is true that Linux was primarily developed using the C language.

    Rate this question:

Quiz Review Timeline +

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

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jun 22, 2014
    Quiz Created by
    Sunil Singhal
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.