Fundamental C Test2

40 Questions | Attempts: 839
Share
SettingsSettings
Please wait...
  • 1/40 Questions

    Every C Program Statement must be terminated with a

    • .
    • #
    • ;
    • !
Please wait...
About This Quiz

This test is to rate your fundamental C concepts

C Programming Quizzes & Trivia

Quiz Preview

  • 2. 

    The process of removing a bug is known as

    • Debugging

    • Compilation

    • Executing

    • Running

    Correct Answer
    A. Debugging
  • 3. 

    ++I is a ----------------------operator.

    • Pre-decrement

    • Pre-increment

    • Post increment

    • Post decrement

    Correct Answer
    A. Pre-increment
  • 4. 

    C language has been developed by

    • Martin Richards

    • Ken Thompson

    • Peter Norton

    • Dennis Ritchie

    Correct Answer
    A. Dennis Ritchie
  • 5. 

    The symbol for right shift operator is

    • − >

    • >

    • >>

    Correct Answer
    A. >>
  • 6. 

    Format specifier for the string is

    • %u

    • %d

    • %c

    • %s

    Correct Answer
    A. %s
  • 7. 

    x=9-12/3+3*2-1, what is the value of x

    • -10

    • 10

    • 4

    • 2

    Correct Answer
    A. 10
  • 8. 

    The equality relational operator is represent by

    • :=

    • ==

    • .EQ

    • =

    Correct Answer
    A. ==
  • 9. 

    Size of (double) returns———

    • 8

    • 2

    • 10

    • 4

    Correct Answer
    A. 8
  • 10. 

    The conditional operators “ ? :” is similar to

    • Nested if

    • If-then-else

    • While

    • Do-while

    Correct Answer
    A. If-then-else
  • 11. 

    What could be output of the following function main( ) {int x=2,y=6,z=6; x=y=z; printf(“%d”,x); }

    • 2

    • 1

    • 0

    • 6

    Correct Answer
    A. 6
  • 12. 

    Which of the following is a valid numeric constant

    • 20,000

    • 15 750

    • $1000

    • 65432

    Correct Answer
    A. 65432
  • 13. 

    The keyword is used to define a new data type.

    • Array

    • Structure

    • Typedef

    • Union

    Correct Answer
    A. Typedef
  • 14. 

    The purpose of the following fragment B=S+B S=B-S; B=B-S; Where S,B are two integers is to

    • Negate the contents of S and B

    • Swap the contents of S and B

    • Transfer the contents of S to B

    • Transfer the contents of B to S

    Correct Answer
    A. Swap the contents of S and B
  • 15. 

    Which of the following is allowed in a C arithmetic statement

    • ( )

    • [ ]

    • { }

    • / /

    Correct Answer
    A. ( )
  • 16. 

    How would you declare a constant of 5 called “MYCONST”?

    • #define MYCONST 5

    • Var int MYCONST=5

    • Int myconst = 5;

    • Constant MYCONST = 5;

    Correct Answer
    A. #define MYCONST 5
  • 17. 

    Which of the following is the assignment operator in C

    • !=

    • = =

    • =

    • : =

    Correct Answer
    A. =
  • 18. 

    ‘void’ means

    • 1

    • Nothing

    • Something not known

    • 0

    Correct Answer
    A. Nothing
  • 19. 

    What is output of following Program? main( ) {int x=10,y=5,p,q ; p= x> 9 ; q= x > 3 && y != 3 ; printf( “p=%d q=%d ” ,p,q) ; }

    • P =0 q = 0

    • P = 0 q = 1

    • P = 1 q= 0

    • P = 1 q = 1

    Correct Answer
    A. P = 1 q = 1
  • 20. 

    What function is appropriate for accepting a string?

    • Getch ( )

    • Gets( )

    • Getche ( )

    • Scanf ( )

    Correct Answer
    A. Gets( )
  • 21. 

    In the following which one is not a C keyword?

    • Choice

    • Case

    • For

    • Volatile

    Correct Answer
    A. Choice
  • 22. 

    What is the range of unsigned char data type

    • 0 to 512

    • 0 to 255

    • -128 to 127

    • -32, 768 to 32,767

    Correct Answer
    A. 0 to 255
  • 23. 

    main( ) { int a=0; if(a) printf(“%d”,++a); else printf(“%d”, a+=2) ; } the output is

    • 3

    • 1

    • 2

    • 0

    Correct Answer
    A. 2
  • 24. 

    What type of errors are checked during compilation

    • Divide by zero error

    • Logical errors

    • Run - time errors

    • Syntax errors

    Correct Answer
    A. Syntax errors
  • 25. 

    Pick the operators that associates from right to left

    • %

    • -

    • =

    • +

    Correct Answer
    A. =
  • 26. 

    C variable cannot start with

    • A lower case

    • An underscore

    • A number

    • An upper case letter

    Correct Answer
    A. A number
  • 27. 

    What symbol is used to represent input/output operations in a flow chart.

    • Rectangles

    • Parellograms

    • Circles

    • Rectangle with rounded end

    Correct Answer
    A. Parellograms
  • 28. 

    What is range of char data value?

    • -128 to 127

    • -64 to 64

    • 0 to 255

    • -127 to 128

    Correct Answer
    A. -128 to 127
  • 29. 

    The function -------------------echoes the character typed on the screen

    • Getchar()

    • Gets()

    • Getche()

    • Getchr()

    Correct Answer
    A. Getche()
  • 30. 

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

    • Any number

    • 2

    • 3

    • 1

    Correct Answer
    A. Any number
  • 31. 

    Which of the following cannot be used as an identifier.

    • Alphabet followed by digit

    • Keywords

    • Alphabet

    • Library function name

    Correct Answer
    A. Keywords
  • 32. 

    Which of the following shows the correct hierarchy of arithmetic operations in C

    • ( ), &&, *,/,+,-

    • ( ), &&, / , *, +, -

    • ( ),&&,*or / + or -;

    • ( ), / or *, - or +

    Correct Answer
    A. ( ), / or *, - or +
  • 33. 

    Which of the following is not a key word of C?

    • Main

    • Void

    • Const

    • Sizeof

    Correct Answer
    A. Main
  • 34. 

    switch(ch) {case ‘a’: printf(“a”); case ‘b’: printf(“b”); default: printf(“error”); } if ch is assigned to the character ‘a’ then the output will be

    • A b

    • A b error

    • A

    • Error

    Correct Answer
    A. A b error
  • 35. 

    What is the result of 5 &&2 ?

    • 0

    • 2

    • 1

    • 5

    Correct Answer
    A. 1
  • 36. 

    The output of the following program is main( ) {int i=2; printf(“%d %d %d”,i++,i,++i); }

    • 2 2 4

    • 2 3 3

    • 3 3 3

    • 2 3 4

    Correct Answer
    A. 3 3 3
  • 37. 

     Which function returns single character

    • Printf

    • Putchar

    • Scanf

    • Getchar

    Correct Answer
    A. Getchar
  • 38. 

    In switch (expression) statement, the expression should evaluate to

    • A void

    • An integer

    • A character

    • A float

    Correct Answer
    A. An integer
  • 39. 

    main( ) { float a; int x = 6; y = 4; a = x/y; print (“%f”,a) }what is the output

    • Error

    • 1.5

    • 0.5

    • 1.00

    Correct Answer
    A. 1.00
  • 40. 

    Among the following operators, whose associatively is right to left

    • Logical operators

    • Arithmetic operators

    • Conditional expression

    • Bitwise operators

    Correct Answer
    A. Conditional expression

Quiz Review Timeline (Updated): Jul 30, 2011 +

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

  • Current Version
  • Jul 30, 2011
    Quiz Edited by
    ProProfs Editorial Team
  • Jan 06, 2010
    Quiz Created by
    Sudha_test
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.