Programming In C Solved MCQs


 Programming In C MCQs

This section contains more frequently asked Programming In C MCQs in the various University Level and Competitive Examinations.
 

Practice it now to sharpen your concepts and knowledge

 

1.What is the older high-level(non-assembler) programming language?
  • C
  • Lisp
  • Fortan 
  • Basic
C. Fortan 
2.The primary progenitor of COBOL was the programming language known as:
  • Pseudocode
  • short Code
  • speedcode
  • flow-matic.
D. flow-matic.
3.The C++ programming language is very popular because it is:
  • backward compatible with C.
  • widely available.
  • object-oriented.
  • all of the above.
C. object-oriented.
4.What innovation introduced in ALGOL68 is ofter credited to pascal?
  • user-defined data types
  • block statement
  • select statement
  • bit-string
B. block statement
5.The most common programming languages ,dating back to the 1940s are called:
  • functional
  • rule-based.
  • object-oriented
  • imperative.
D. imperative.
6.When did the first ANSI programming language stander d come out?
  • 1949
  • 1975
  • 1958 
  • 1966
C. 1958 
7.List in chronological order, when these languages become officially recognized as a standard
  • ANSI C
  • ANSI COMMON LISP
  • ANSI Cobol 
  • ANSI ADA
C. ANSI Cobol 
8.Who uses languages which are standards? (i)Processors (ii)Technicians (iii) Students (iv)Managers
  • i,ii & iii only
  • ii & iv only
  • iii & iv only
  • all of the above
D. all of the above
9. What features make C++ so powerful?
  • Easy Implementations
  • Reusing the old code
  • Easy Memory Management 
  • All of the above
C. Easy Memory Management 

 

1.What makes OOP so popular? (i) Data abstraction (ii) Easily reusable (iii) Easily modifiable (iv) None of the above
  • i only
  • i, ii & iii only
  • ii & iii only
  •  iv only
D.  iv only
2.Which of the following languages has the potential to become the next programming language standard? (i) Java (ii) Html (iii) Cobol 97 (iv) ADA 95
  • i & iv only
  • i & iii only
  • ii & iii only
  • none of the above
B. i & iii only
3.Which of the following languages is the newest?
  • Fortran
  • Lisp
  • Simula
A. C 
4.Which of the following languages is the oldest?
  • Perl 
  • PHP
  • Python
  • Ruby
A. Perl 
5.Which of the following languages introduced the notion of inheritance?
  • Simula 
  • Smalltalk
  • Algol 68
  • C++
A. Simula 
6.Which of the following are language processors?
  • Assembler
  • Compiler
  • Interpreter
  • All of the above
D. All of the above
7.A program in execution is called
  • process 
  • function
A. process 
8.An assembly language is a
  •  low level programming language
  • CPU
  • High level programming language
  • Memory
A.  low level programming language

 

1.An assembler is
  • Programming language dependent.
  • Machine dependant.
  • Syntax dependant.
  • Data dependant
  • ans2
2.Translator for low level programming language were termed as
  • Assembler
  • Compiler
  • Linker
  • Loader
  • ans1
3.What is the name of the category of programming languages whose structure is dictated by the von Neuman computer architecture?
  • Imperative
  • Functional
  • Constraint
  • Denotational
  • ans1
4.A paradigm that allows specification of what has to be computed rather than just how a computation is to be carried out.
  • Imperative
  • Functional
  • Non-procedural
  • Object-oriented
  • ans3
5.A paradigm incorporating encapsulation. Inheritance and dynamic type binding
  • Imperative
  • Functional
  •  Denotational
  • Object-oriented
  • ans4
6.Which language is considered to be the first fully object-oriented language?
  • FORTRAN
  • LISP
  • JAVA
  • COBOL
  • ans3
7.In what language is UNIX written?
  • FORTRAN
  • LISP
  • JAVA
  • C
  • ans3
8.What programming language has dominated scientific computing over the past 35 years?
  • FORTRAN
  • JAVA
  • COBOL
  • SMALL TALK
  • ans1
9.What programming language has dominated artificial intelligence programming over the past 35years?
  • FORTRAN
  • LISP
  • JAVA
  • COBOL
  • ans2
10.What programming language has dominated business applications over the past 35 years?
  • FORTRAN
  • JAVA
  • COBOL
  • SMALL TALK
  • ans3

 


1.What language has slogan ‘write once run anywhere’?
  • FORTRAN
  • LISP
  • JAVA
  • COBOL
  • C
C. JAVA
2.How is Scheme opposite to Common Lisp?
  •  Scheme is large and complex; Common Lisp is small.
  • Common Lisp is not an ANSI standard; Scheme is.
  • Scheme is exclusively statically scoped; Common Lisp supports dynamic scoping.
  • Common Lisp is interpreted; Scheme is compiled.
A.  Scheme is large and complex; Common Lisp is small.
3.Why must local variables in Lisp generally be allocated in the heap, rather than on the Stack
  • Because we don’t know their sizes at compile time.
  • Because local variables in Lisp have unlimited extent.
  • Because Lisp subroutines don’t follow strict LIFO calling conventions.
  • Because the Lisp garbage collector is unable to manipulate addresses in the stack.
B. Because local variables in Lisp have unlimited extent.
4.through Q 38 refer to the following program in Scheme: (define add-n (lambda (n) (lambda (m) (+ m n)))) (let ((n 4) (f (add-n 3))) (+ n (f 2))) What does this program print?
  • 8
  •  9 
  • 10
  • none of the above
B.  9 
5.What would the program print if Scheme used dynamic scope and shallow binding?
  • 8
  •  9 
  • 10
  • none of the above
B.  9 
6.What would be the program print if scheme used dynamic scope and deep binding?
  • 8
  •  9 
  • 10
  • none of the above
B.  9 
7.The fact that the program contains two variables named n is an example of
  • Overloading
  • Aliasing
  • Both
  • neither
D. neither
8.What would happen (in real scheme) if we reversed the order of the two definitions in the let block?
  • Nothing: the program would behave the same
  • The output would change,because f would capture a different n
  • The interpreter would complain that n is being used before it is declared
  • The interpreter would complain that the meaning of n is ambiguous
A. Nothing: the program would behave the same
9.Which of the following is not an example of a high-level programming language?
  • Machine language
  • Assembly language
  • High level language
  • Natural language
D. Natural language
10.Which of the following is not an example of a high-level programming language?
  • C++
  • PASCAL
  • Babbage 
  • BASIC
C. Babbage 

 

1.First high level language to be implemented on personal computers
  • FORTRAN 
  • BASIC
  • PASCAL
A. FORTRAN 
2.Hungarian Notation is used to
  • Design system manual
  • Design user manual
  • Define name of the variable depending on its use and data type
  • All
A. Design system manual
3.Java is a
  • Machine level language
  • Middle level language
  • High level language 
  • None
C. High level language 
4.SNOBOL is mainly used for
  • List operations
  • Numerical operations
  • Text Operation
  • None
D. None
5.Which of the following is not case sensitive language?
  • C
  • Java 
  • C++
  • None
B. Java 
6.FORTRAN is a
  • General purpose and procedural language
  • Imperative programming language
  • Both A and B
  • None
C. Both A and B
7.An assembly language consists of following which type of instructions.
  • Mnemonics
  • Opcodes
  • Operands
  • Fields
A. Mnemonics
8.‘C’ is a
  • Assembly language
  • Middle level language
  • High level language
  • None
C. High level language
9.Structured programming languages are also known as
  •  Modular 
  • Case sensitive
  • Pseudocode
  • Object oriented language
A.  Modular 
10.Which of the following is a case sensitive language?
  • C++
  • Pascal
  • BASIC
  • All
D. All

 

1.Which of the following factors should be considered while selecting a programming language for application development?
  • Nature of the application
  • Ease of learning the language
  • Familiarity with the language
  • All
D. All
2.Which of the following is best suited for system-level programming
  • BASIC
  • FORTRAN
  • none
B. C 
3.Java compiler produces
  • Byte code 
  • Object code
  • Executable code
  • None
A. Byte code 
4.Which of the following languages are difficult to modify
  • Machine level language
  • Assembly level language
  • High level language
  • None
A. Machine level language
5.Variables created in MATLAB can be seen in ___________ _
  • Command Window
  • Command History
  • Workspace
  • Current Directory
C. Workspace
6.ll variables created can be saved using command
  • Save
  • Load
  • log
  • None
A. Save
7.What is right way to create a 3×3 matrix A?
  • Matrix(A,3,3)
  • A(3,3)
  • A[123,123,123]
  • A[123; 123; 123]
D. A[123; 123; 123]
8.Transpose of matrix A can be calculated by:
  • A’ 
  • inv(A)
  • A”
A. A’ 
9.A trigonometric operation ‘sin(A)’ on matrix A will affect
  • First row elements of A
  • First column elements of A
  • All elements of A.
  • First and Last element of A
B. First column elements of A
10.“log2′ function is used for
  • Calculating logarithm of two numbers
  • Calculate log to the base 2
  • Calculate log of 2 with given no as base
  • None
C. Calculate log of 2 with given no as base

 

1.Comment on the output of following code:1. #include 2. main() 3. { 4. char *p = 0; 5. *p = ‘a’; 6. printf(“value in pointer p is %c\n”, *p); 7. }
  • It will print a
  • It will print 0
  • Compile time error
  • Run time error
C. Compile time error
2.Which of the following is a keyword used for a storage class?
  • Printf
  • externa
  • auto
  • scanf
C. auto
3.The prototype of the function in the header file isA]Stdio.h
  • stdlib.h
  • conio.h
  •  io.h
  • Stdio.h
D. Stdio.h
4.Preprocessor Directives are used for –
  • Macro Expansion
  • File Inclusion
  • Conditional Compilation
  • All of these
B. File Inclusion
5.Which function is used to read character as you type ?
  • getchar()
  • getch()
  • getche()
  • Both (B) and (C
A. getchar()
6.Which format specifier is used to print the values of double type variable
  • %If
  • %Id
  • %Iu
  • %f
A. %If
7.What will be the output of the following program? Void main( ) { Int x []= {10,20,30,40,50}; Print f (“ \n %d %d %d %d “, x [4] ,3[x] ,x[2] ,1[x] ,x[0] ); }
  • Error
  • 10 20 30 40 50
  • 50 40 30 20 10
  • None of these
A. %If
8.Which of the following is not s keyword of ‘C’ ?
  • auto
  • register
  • int
  • function
A. %If
9. What will be the output ? #define SQUARE(X) X * X void main ( ) { printf (“\n Square = %d” , SQUARE(10+2) ); }
  • Square = 144
  • Square =32
  • Square =122
  • Square =12
A. %If
10.By default a function returns a value of type
  • int
  • char
  • void
  • None of these
A. %If

 1.What will be the value of x after executing the program ?void main ( ) { int x; x = printf(“I See, Sea in C”); printf(“\n x= % d” , x); }

  • x= 15
  • x=2
  • Garbage value
  • Error
D. Error
2.Which is not keyword in ‘C’ ?
  • typedef
  • const 
  • near 
  • complex
C. near 
3.Which is valid string function ?
  • strpbrk
  • strlen 
  • strxfrm
  • strcut
B. strlen 
4.A static variable by default gets initialized to
  • 0
  • blank space
  • 1
  • garbage value
D. garbage value
5.What will be the size of following union declaration?int **x;
  • x is a pointer to pointer 
  • x is not pointer
  • x is long
  • None of these
A. x is a pointer to pointer 
6.What will be the size of following union declaration?Union Test { Int x; Char c[10 Char y; Float z; } ;
  • 10 bytes 
  • 4bytes
  • 1byte
  • 4 bytes
A. 10 bytes 
7.Which of the following are tokens in C?
  • Keywords
  • Variables
  • Constants
  • All of the above
D. All of the above
8.The size of a String variable is
  • 1 byte 
  • 8 bytes
  • 16 bytes
  • None
A. 1 byte 
9.Operators have hierarchy. It is used to know which operator
  • is most important 
  • is used first 
  • is faster
  • operates on large numbers
B. is used first 

 

1.Header files in C contain
  • Compiler commands
  • Library functions
  • Header information of C programs
  • Operators for files
B. Library functions
2.Identify the wrong statement
  • putchar(65) 
  • putchar(‘x’) 
  • putchar(“x”)
  • putchar(‘\n’)
B. putchar(‘x’) 
3.Which header file is essential for using strcmp() function?
  • string.h 
  • strings.h
  • text.h
  • strcmp.h
A. string.h 
4.Which of the following is a key word is used for a storage class
  • printf
  • external 
  • auto 
  • scanf
C. auto 
5.An Ampersand before the name of a variable denotes
  • Actual Value
  • Variable Name
  • Address 
  • Data Type
C. Address 

 1.Who invented the C – Programming?

  • James Gosling
  • Dennis Ritche
  • Bjarne Stroustrup’s
  • Tim Berners-Lee
B. Dennis Ritche
2.Where does C language get invented?
  • Ritche’s Lab
  • AT & T Bell Labs
  • Under Oak Tree
  • Fringe Labs
B. AT & T Bell Labs
3.Which symbol terminates a C statement?
  • .
  • ,
  • ;
  • }
C. ;
4.How to comment in C language?
  • //Comment
  • /* Comment */
  • <—Comment—->
  • A & B
B. /* Comment */
5.Which of the following operator takes only integer operands?
  • +
  • *
  • /
  • %
D. %
6.Pick the operator that not associates from the left?
  • +
  • =
  • <
D. <
7.In a for loop, if the condition is missing, then?
  • it is assumed to be present and taken to be false
  • it is assumed to be present and taken to be true
  • it result in the syntax error
  •  execution will be terminated abruptly
D.  execution will be terminated abruptly
8.The maximun value that an integer constant can have is ?
  • -32767
  • 32767
  • 1.7014E+38
  • -1.7014E+38
B. 32767
9.A C variable cannot start with ?
  • An alphabet
  • A number
  •  A special symbol other than underscore
  • Both (2) and (3)
D. Both (2) and (3)
10.C programs are convrted into the machine language with the help of ?
  • An editor
  • Compiler
  • An operating system
  • None of the above
B. Compiler

 

    

Post a Comment

Previous Post Next Post