LakshyaEducation.in

VEDIC MATHS Video Series
  • Home
  • Video Series
    • Vedic Maths Videos
    • Quantitative Aptitude Videos
    • Class 8 Maths Videos
    • Class 9 Maths Videos
    • Class 10 Maths Videos
  • Quiz & Solutions
  • Blog
  • Store
  • Login
  • Contact Us
  • Home
  • Topic
  • C Programming
  • Functions

C Programming

FUNCTIONS MCQs

Total Questions : 63

Page 1 of 7 pages
Question 1.

In a function two return statements should never occur.


  1.    Yes
  2.    No
 Discuss Question
Answer is Option B. -> No

No, In a function two return statements can occur but not successively. Example:

#include<stdio.h> int mul(int, int); /* Function prototype */ int main() { int a = 0, b = 3, c; c = mul(a, b); printf("c = %d\n", c); return 0; } /* Two return statements in the mul() function */ int mul(int a, int b) { if(a == 0 || b == 0) { return 0; } else { return (a * b); } }

Output: c = 0

Question 2.

Is it true that too many recursive calls may result into stack overflow?


  1.    Yes
  2.    No
 Discuss Question
Answer is Option A. -> Yes

Yes, too many recursive calls may result into stack overflow. because when a function is 

called its return address is stored in stack.

After sometime the stack memory will be filled completely. Hence stack overflow error will occur.

Question 3.

Usually recursion works slower than loops.


  1.    Yes
  2.    No
 Discuss Question
Answer is Option A. -> Yes

When a recursive call is made, the function/process clones itself and then process that funtion. 

This leads to time and space constrains.

In a loop, there is no recursive call involved that saves a lot of time and space too.

Question 4.


Will the following functions work?



int f1(int a, int b)
{
return ( f2(20) );
}
int f2(int a)
{
return (a*a);
}

  1.    Yes
  2.    No
 Discuss Question
Answer is Option A. -> Yes

Yes, It will return the value 20*20 = 400 Example:

#include<stdio.h> int f1(int, int); /* Function prototype */ int f2(int); /* Function prototype */ int main() { int a = 2, b = 3, c; c = f1(a, b); printf("c = %d\n", c); return 0; } int f1(int a, int b) { return ( f2(20) ); } int f2(int a) { return (a * a); }

Output: c = 400

Question 5.

Maximum number of arguments that a function can take is 12


  1.    Yes
  2.    No
 Discuss Question
Answer is Option B. -> No

No, C can accept upto 127 maximum number of arguments in a function.

Question 6.

If a function contains two return statements successively, the compiler will generate 

warnings. Yes/No ?


  1.    Yes
  2.    No
 Discuss Question
Answer is Option A. -> Yes

Yes. If a function contains two return statements successively, the compiler will GENERATE "Unreachable code" warnings. Example:

#include<stdio.h> int mul(int, int); /* Function prototype */ int main() { int a = 4, b = 3, c; c = mul(a, b); printf("c = %d\n", c); return 0; } int mul(int a, int b) { return (a * b); return (a - b); /* Warning: Unreachable code */ }

Output: c = 12

Question 7.

Names of functions in two different files linked together must be unique


  1.    True
  2.    False
 Discuss Question
Answer is Option A. -> True

True, If two function are declared in a same name, it gives "Error: Multiple declaration 

of function_name())".

Question 8.

Every function must return a value


  1.    Yes
  2.    No
 Discuss Question
Answer is Option B. -> No

No, If a function return type is declared as void it cannot return any value.

Question 9.

A function may have any number of return statements each returning different values.


  1.    True
  2.    False
 Discuss Question
Answer is Option A. -> True

True, A function may have any number of return statements each returning different values and each return statements will not occur successively.

Question 10.

Functions cannot return a floating point number


  1.    Yes
  2.    No
 Discuss Question
Answer is Option B. -> No

A function can return floating point value. Example:

#include<stdio.h> float sub(float, float); /* Function prototype */ int main() { float a = 4.5, b = 3.2, c; c = sub(a, b); printf("c = %f\n", c); return 0; } float sub(float a, float b) { return (a - b); }

Output: c = 1.300000

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • Next →
  • Share on Facebook!
  • Share on Pinterest!

Sub Topics

  • Arrays
  • Bitwise Operators
  • C Preprocessor
  • Command Line Arguments
  • Complicated Declarations
  • Const
  • Control Instructions
  • Declarations And Initializations
  • Expressions
  • Floating Point Issues
  • Functions
  • Input / Output
  • Library Functions
  • Memory Allocation
  • Pointers
  • Strings
  • Structures
  • Subleties Of Typedef
  • Variable Number Of Arguments

Recent Posts

  • Ssc Exam Guide Book
  • Sail E0 Results 2022
  • Sail E0 Exam Results Cancelled - Exam Will Be Rescheduled
  • Vedic Maths Faq
  • Best Ssc Exam For Girls
  • Is Ssc Difficult Than Upsc?
  • Quantitative Aptitude Faqs

Recent Questions

Q.   The Value Engineering Technique In Which Experts Of The Same....

Q.   If Transcription Should Not Be Carried Out Beyond The Insert....

Q.   Buffalo Is To Leather As Llama Is To....?

Q.   Choose The Correct Answer From The Given Options To Fill The....

Q.   The Arithmetic Mean (average) Of The First 10 Whole Numbers ....

Q.   Which Governor General Is Remembered For The Annulment Of Th....

Q.   When The Voltage Across A Capacitor Is Tripled, The Stored C....

Q.   My Mother Bakes Cakes.

Q.   Log Mean Temperature Difference In Case Of Counter Flow Comp....

Q.   Which Of The Following Is Not A Matter Of Local Government?

Q.   Which Drugs Can Easily Pass The Placental Barrier?

Q.   Which Of The Following Is Not A Benefit Of BLAST?

Q.   A Part Of John's Salary Was Cut By The Government. What....

Q.   The Swollen Part Of The Pistil Is Known As ________ .

Q.   By Definition, Make A Map Is To Select Certain Features As R....

Q.   Which Of The Following Is The Best Tube Material From Therma....

Q.   If You Are Going To Use A Combination Of Three Or More AND A....

Q.   (a) A Ball Is Dropped From A Height Of 30m. After Striking T....

Q.   What Is The Approx. Value Of W, If W=(1.5)11, Given Log2 = 0....

Q.   In The Following Questions, The Symbols $, ©, *, @ And # Ar....

Topics

Computer Aptitude
SAIL Junior Officer (E-0)
10th Grade
11th Grade
12th Grade
4th Grade
5th Grade
6th Grade
7th Grade
8th Grade
9th Grade
NCERT
Cat
Commerce
Computer Science
Engineering
English
General Knowledge
Ias
Management
Quantitative Aptitude
Reasoning Aptitude
General Studies (Finance And Economics)
Vedic Maths
Analytical Instrumentation
Biochemistry
Bioinformatics
Biology
Biotechnology
Bitsat
Business Statistics
C Programming
C++ Programming
Cell Biology
Chemistry
Cost Accounting
Drug And Pharmaceutical Biotechnology
Electrical Measurement And Instrumentation
Environment Management
Environmental Biotechnology
Enzyme Technology
Financial Management And Financial Markets
Gate
General Science
Geography
Heat Transfer
History And National Movements
Human Anatomy And Physiology
Human And Cultural Diversity
Human Resource Management
Indian Economy
Indian Geography
Indian History
Indian Polity
Instrumentation Transducers
International Relations
Life Sciences
Marketing And Marketing Management
Mass Transfer
Mechanics Of Materials
Microbiology
Neet
Professional Communication
Renewable Energy
Sociology
Surveying
Total Quality Management
Uidai Aadhaar Supervisor Certification
Virology
LakshyaEducation.in
Lakshya Education
Bhilai,Chattisgarh,India
Email: admin@lakshyaeducation.in Phone: 07893519977 (WhatsApp)

Quick Links

  • Vedic Maths
  • Quantitative Aptitude
  • Class – IX Maths
  • Class – X Maths
  • Blog

Our Services

  • About us
  • Privacy
  • TOS
  • Refund / Cancellation
  • Contact
  • Affiliate Program
  • Copyright © 2022 All Right Reserved | Lakshya Education     ( )
    Login / Register

    Your Account will be created automatically when you click the below Google or Facebook Login Button.
    •   Login With Facebook
    •  Login With Google
     Login With Email/Password