Fundamental C Test1

40 Questions | Attempts: 1476
Share

SettingsSettingsSettings
Fundamental C Test1 - Quiz

This is a fundamental C test


Questions and Answers
  • 1. 
    What type of errors are checked during compilation
    • A. 

      Logical errors

    • B. 

      Divide by zero error

    • C. 

      Run - time errors

    • D. 

      Syntax errors

  • 2. 
    The purpose of main function is
    • A. 

      To stop program execution

    • B. 

      To stop algorithm

    • C. 

      To start algorithm

    • D. 

      To start program execution

  • 3. 
    What is the valid identifier in the following
    • A. 

      1fdasgf

    • B. 

      @hgd12

    • C. 

      Fahs%*

    • D. 

      Q1234

  • 4. 
    What is range of char data value?
    • A. 

      -64 to 64

    • B. 

      -128 to 127

    • C. 

      0 to 255

    • D. 

      -127 to 128

  • 5. 
    The minimum number of temporary variable needed to swap the contents of two variable is
    • A. 

      3

    • B. 

      1

    • C. 

      0

    • D. 

      2

  • 6. 
    What is output of following program ? main( ) {int x; x= 4 + 2 % 8; printf(“%d”,x); }
    • A. 

      6

    • B. 

      4.25

    • C. 

      4

    • D. 

      -6

  • 7. 
    When && operator is used with two conditions, conditions need to be satisfied for the expression to be true.
    • A. 

      Neither

    • B. 

      Only first

    • C. 

      Any one

    • D. 

      Both

  • 8. 
    In the expression b=6.6/a+(2*a+(3*c)/a*d)/(2/n); which operation will be performed first?
    • A. 

      2*a

    • B. 

      2/n

    • C. 

      3*c

    • D. 

      6.6/a

  • 9. 
    What is the output of printf(“%d”,printf(“tim”));
    • A. 

      Garbage

    • B. 

      Results in a syntax error

    • C. 

      Printf tim and terminates abruptly

    • D. 

      Tim3

  • 10. 
    What is output of the following program? main( ) {int x=15,y; y=(x >5)? 3 : 4; printf(“%d”,y); }
    • A. 

      2

    • B. 

      4

    • C. 

      3

    • D. 

      1

  • 11. 
    What symbol is used to represent the connector
    • A. 

      Parellogram

    • B. 

      Rectangle with rounded end

    • C. 

      Circle

    • D. 

      Rectangle

  • 12. 
    Bitwise operators cannot be performed on
    • A. 

      Float

    • B. 

      Long int

    • C. 

      Int

    • D. 

      Char

  • 13. 
    The ANSI C standard recognizes maximum length of a variable up to
    • A. 

      8 characters

    • B. 

      Unlimited characters

    • C. 

      31 characters

    • D. 

      15 characters

  • 14. 
    Which of the following is an incorrect variable name.
    • A. 

      Else

    • B. 

      Name

    • C. 

      string

    • D. 

      Age

  • 15. 
    What is the size of long double variable
    • A. 

      10 bytes

    • B. 

      8 bytes

    • C. 

      4 bytes

    • D. 

      16 bytes

  • 16. 
    Variables are initialized in C, using
    • A. 

      : =

    • B. 

      >

    • C. 

      =

    • D. 

      ==

  • 17. 
    If a is float variable, a=5/2 will return a value
    • A. 

      2.5

    • B. 

      2

    • C. 

      2.0

    • D. 

      3

  • 18. 
    Int a=13,b=7,c; c=a&b what is the value of c
    • A. 

      0000 0000 0000 0101

    • B. 

      0000 0000 0000 0100

    • C. 

      0000 0000 0000 0110

    • D. 

      0000 0000 0001 0101

  • 19. 
    In the following, which is bitwise operator?
    • A. 

      >

    • B. 

      *

    • C. 

      |

    • D. 

  • 20. 
    If y is of integer type variable then the two expressions. 3*(y-8)/9 and (y-8)/9*3 yield the same value if
    • A. 

      Y-8 is an integer multiple of 3

    • B. 

      Y is an odd number

    • C. 

      Y is an even number

    • D. 

      Y-8 is an integer multiple of 9

  • 21. 
    What is output of the following program? main() {int a; float b; a=1/2; b=1.0/2.0; printf(“ a=%d b=%f”,a,b); }
    • A. 

      A=0.0 b=0. 5

    • B. 

      A=0 b=0. 5

    • C. 

      A=0.0 b= 5

    • D. 

      A=0.5 b=0. 5

  • 22. 
    Representing various steps in a flow diagram is called as
    • A. 

      Diagram

    • B. 

      Flow chart

    • C. 

      Program

    • D. 

      Paint

  • 23. 
    C is a
    • A. 

      Machine language

    • B. 

      High level language

    • C. 

      High level language with some low level features

    • D. 

      Low level language

  • 24. 
    What are the smallest individual units in a program
    • A. 

      Structures

    • B. 

      Functions

    • C. 

      record

    • D. 

      Tokens

  • 25. 
    Which of the following is an empty data type.
    • A. 

      Integer

    • B. 

      Float

    • C. 

      Character

    • D. 

      Void

Back to Top Back to top
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.