logo
  • Home
  • About
  • Training
  • Programming
  • CS
  • IT
  • IS
  • ECE
  • EEE
  • EE
  • Civil
  • Mechanical
  • Chemical
  • Metallurgy
  • Instrumentation
  • Aeronautical
  • Aerospace
  • Biotechnology
  • Agriculture
  • MCA
  • BCA
  • Internship
  • Contact

C Multiple Choice Questions | MCQs | Quiz

C Programming Interview Questions and Answers
Pratice C Programming questions and answers for interviews, campus placements, online tests, aptitude tests, quizzes and competitive exams.

Get Started

•   Variable Names - 1
•   Variable Names - 2
•   Data Types
•   Data Sizes
•   Constants - 1
•   Constants - 2
•   Declarations - 1
•   Declarations - 2
•   Arithmetic Operators - 1
•   Arithmetic Operators - 2
•   Relational Operators
•   Logical Operators
•   Type Conversions - 1
•   Type Conversions - 2
•   Increment Operators
•   Decrement Operators
•   Bitwise Operators - 1
•   Bitwise Operators - 2
•   Assigment Operators
•   Expressions
•   Conditional Expressions - 1
•   Conditional Expressions - 2
•   Operator Precedence - 1
•   Operator Precedence - 2
•   Order of Evaluation - 1
•   Order of Evaluation - 2
•   Associativity - 1
•   Associativity - 2
•   If Statements - 1
•   If Statements - 2
•   Switch Statements - 1
•   Switch Statements - 2
•   For Loops - 1
•   For Loops - 2
•   While Loops - 1
•   While Loops - 2
•   Break & Continue - 1
•   Break & Continue - 2
•   Goto & Labels - 1
•   Goto & Labels - 2
•   Functions Basics - 1
•   Function Basics - 2
•   Functions Return
•   Return Values
•   External Variables - 1
•   External Variables - 2
•   Variable Scope - 1
•   Variable Scope - 2
•   Static Variables - 1
•   Static Variables - 2
•   Register Variables - 1
•   Register Variables - 2
•   Automatic Variables - 1
•   Automatic Variables - 2
•   Preprocessor - 1
•   Preprocessor - 2
•   File Inclusion - 1
•   File Inclusion - 2
•   Macro Substitution - 1
•   Macro Substitution - 2
•   Conditional Inclusion - 1
•   Conditional Inclusion - 2
•   Pointers & Addresses - 1
•   Pointers & Addresses - 2
•   Function Arguments - 1
•   Pointers Arguments 2
•   Pointers & Arrays - 1
•   Pointers & Arrays - 2
•   Address Arithmetic - 1
•   Address Arithmetic - 2
•   Pointers/Functions - 1
•   Pointers/Functions - 2
•   Pointers to Pointers - 1
•   Pointers to Pointers - 2
•   Multidimensional Arrays - 1
•   Multidimensional Arrays - 2
•   Pointer Arrays Init - 1
•   Pointer Arrays Init - 2
•   Multi-dimensional Arrays - 1
•   Multi-dimensional Arrays - 2
•   Command Line Arguments1
•   Command Line Arguments2
•   Pointers to Functions - 1
•   Pointers to Functions - 2
•   Complicated Declarations-1
•   Complicated Declarations-2
•   Structures - 1
•   Structures - 2
•   Structures & Functions - 1
•   Structures & Functions - 2
•   Arrays of Structures - 1
•   Arrays of Structures - 2
•   Pointer to Structures - 1
•   Pointer to Structures - 2
•   Self-Referential Structures-1
•   Self-Referential Structures-2
•   Table Lookup - 1
•   Table Lookup - 2
•   Typedefs - 1
•   Typedefs - 2
•   Unions - 1
•   Unions - 2
•   Bit-fields - 1
•   Bit-fields - 2
•   Standard Input & Output - 1
•   Standard Input & Output - 2
•   Printf - 1
•   Printf - 2
•   Varargs - 1
•   Varargs - 2
•   Scanf - 1
•   Scanf - 2
•   File Access - 1
•   File Access - 2
•   Error Handling - 1
•   Error Handling - 2
•   Line Input & Output - 1
•   Line Input & Output - 2
•   String Operations - 1
•   String Operations - 2
•   Character Class - 1
•   Character Class - 2
•   Ungetc - 1
•   Ungetc - 2
•   Storage Management - 1
•   Storage Management - 2
•   Mathematical Functions - 1
•   Mathematical Functions - 2
•   Random Number - 1
•   Random Number - 2
•   Float Datatype - 1
•   Float Datatype - 2
•   Sizeof - 1
•   Sizeof - 2

Best Reference Books

C Programming Books
« Prev Page
Next Page »

C Programming Questions and Answers – Variable Length Argument – 2

Posted on February 2, 2013 by Manish
Sanfoundry’s 1000+ Interview Questions & Answers on C helps anyone preparing for Toshiba and other companies C interviews. One should practice these 1000+ interview questions and answers continuously for 2-3 months to clear Toshiba interviews on C Programming language.

Here is a listing of C interview questions on “Variable Length Argument” along with answers, explanations and/or solutions:

1.The standard header _______ is used for variable list arguments (…) in C.
a) <stdio.h >
b) <stdlib.h>
c) <math.h>
d) <stdarg.h>
View Answer

Answer: d
Explanation: None.

2. va_end does whatever.
a) Cleanup is necessary
b) Must be called before the program returns
c) Cleanup is necessary & Must be called before the program returns
d) None of the mentioned
View Answer

Answer: c
Explanation: None.

3. What is the output of this C code?

  1.     #include <stdio.h>
  2.     int f(char chr, ...);
  3.     int main()
  4.     {
  5.         char c = 97;
  6.         f(c);
  7.         return 0;
  8.     }
  9.     int f(char c, ...)
  10.     {
  11.         printf("%c\n", c);
  12.     }

a) Compile time error
b) Undefined behaviour
c) 97
d) a
View Answer

Answer: a
Explanation: None.

4. What is the output of this C code?

  1.     #include <stdio.h>
  2.     #include <stdarg.h>
  3.     int f(...);
  4.     int main()
  5.     {
  6.         char c = 97;
  7.         f(c);
  8.         return 0;
  9.     }
  10.     int f(...)
  11.     {
  12.         va_list li;
  13.         char c = va_arg(li, char);
  14.         printf("%c\n", c);
  15.     }

a) Compile time error
b) Undefined behaviour
c) 97
d) a
View Answer

Answer: a
Explanation: None.

5. What is the output of this C code?

  1.     #include <stdio.h>
  2.     #include <stdarg.h>
  3.     int f(char c, ...);
  4.     int main()
  5.     {
  6.         char c = 97, d = 98;
  7.         f(c, d);
  8.         return 0;
  9.     }
  10.     int f(char c, ...)
  11.     {
  12.         va_list li;
  13.         va_start(li, c);
  14.         char d = va_arg(li, char);
  15.         printf("%c\n", d);
  16.         va_end(li);
  17.     }

a) Compile time error
b) Undefined behaviour
c) a
d) b
View Answer

Answer: b
Explanation: None.

6. What is the output of this C code?

  1.     #include <stdio.h>
  2.     #include <stdarg.h>
  3.     int f(char c, ...);
  4.     int main()
  5.     {
  6.         char c = 97, d = 98;
  7.         f(c, d);
  8.         return 0;
  9.     }
  10.     int f(char c, ...)
  11.     {
  12.         va_list li;
  13.         va_start(li, c);
  14.         char d = va_arg(li, int);
  15.         printf("%c\n", d);
  16.         va_end(li);
  17.     }

a) Compile time error
b) Undefined behaviour
c) a
d) b
View Answer

Answer: d
Explanation: None.

7. What is the output of this C code?

  1.     #include <stdio.h>
  2.     #include <stdarg.h>
  3.     int f(int c, ...);
  4.     int main()
  5.     {
  6.         int c = 97;
  7.         float d = 98;
  8.         f(c, d);
  9.         return 0;
  10.     }
  11.     int f(int c, ...)
  12.     {
  13.         va_list li;
  14.         va_start(li, c);
  15.         float d = va_arg(li, float);
  16.         printf("%f\n", d);
  17.         va_end(li);
  18.     }

a) Compile time error
b) Undefined behaviour
c) 97.000000
d) 98.000000
View Answer

Answer: b
Explanation: None.

Sanfoundry Global Education & Learning Series – C Programming Language.

Here’s the list of Best Reference Books in C Programming Language.

To practice all features of C programming language, here is complete set of 1000+ Multiple Choice Questions and Answers on C.

« Prev Page - C Programming Questions and Answers – Variable Length Argument – 1
» Next Page - C Programming Questions and Answers – Formatted Input – 1
« C Programming Questions and Answers – Variable Length Argument – 1
C Programming Questions and Answers – Formatted Input – 1 »

Deep Dive @ Sanfoundry:

  1. C Programming Examples on Puzzles & Games
  2. Dynamic Programming Problems and Solutions
  3. C# Programming Examples on Networking
  4. C# Programming Examples on Matrix
  5. C Programming Examples
  6. C# Programming Examples
  7. Java Algorithms, Problems & Programming Examples
  8. C Algorithms, Problems & Programming Examples
  9. C Questions and Answers
  10. C++ Algorithms, Problems & Programming Examples
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer and SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him below:
LinkedIn | Facebook | Twitter | Google+

Best Careers

Developer Tracks
SAN Developer
Linux Kernel Developer
Linux Driver Developer
Linux Network Developer

Live Training Photos
Mentoring
Software Productivity
GDB Assignment
Sanfoundry is No. 1 choice for Deep Hands-ON Trainings in SAN, Linux & C, Kernel Programming. Our Founder has trained employees of almost all Top Companies in India such as VMware, Citrix, Oracle, Motorola, Ericsson, Aricent, HP, Intuit, Microsoft, Cisco, SAP Labs, Siemens, Symantec, Redhat, Chelsio, Cavium, ST-Micro, Samsung, LG-Soft, Wipro, TCS, HCL, IBM, Accenture, HSBC, Mphasis, Tata-Elxsi, Tata VSNL, Mindtree, Cognizant and Startups.

Best Trainings

SAN I - Technology
SAN II - Admin
Linux Fundamentals
Advanced C Training
Linux-C Debugging
System Programming
Network Programming
Linux Threads
Kernel Programming
Kernel Debugging
Linux Device Drivers

Best Reference Books

Computer Science Books
Algorithm & Programming Books
Electronics Engineering Books
Electrical Engineering Books
Chemical Engineering Books
Civil Engineering Books
Mechanical Engineering Books
Industrial Engineering Books
Instrumentation Engg Books
Metallurgical Engineering Books
All Stream Best Books

Questions and Answers

1000 C Questions & Answers
1000 C++ Questions & Answers
1000 C# Questions & Answers
1000 Java Questions & Answers
1000 Linux Questions & Answers
1000 Python Questions
1000 PHP Questions & Answers
1000 Hadoop Questions
Cloud Computing Questions
Computer Science Questions
All Stream Questions & Answers

India Internships

Computer Science Internships
Instrumentation Internships
Electronics Internships
Electrical Internships
Mechanical Internships
Industrial Internships
Systems Internships
Chemical Internships
Civil Internships
IT Internships
All Stream Internships

About Sanfoundry

About Us
Copyright
TOS & Privacy
Jobs
Bangalore Training
Online Training
SAN Training
Developers Track
Mentoring Sessions
Contact Us
Sitemap
© 2011 Sanfoundry