SlideShare a Scribd company logo
1 of 24
Frequently Asked Questions
in C!

Developed by David Livingsto J, Coimbatore

Contact email: davidjlivingston@gmail.com

Blogs maintained by the author includees:

futureforyou.net

futureforyou.biz
1. List out the various
arithmetic operators in C?
+ Addition
- Subtraction
* Multiplication
/ Divison
% Modulo Division
2. What is an arithmetic
expression?
An arithmetic expression is a combination arithmetic
operators and operands of type integer.
3) What are the various
relational operators in C?
< Less than
> Greater than
= Equal
!= Not equal
>= Greater than or equal to
<= Lesser than or equal to
4) Write the various logical
operators in C?
&& - Logical AND
|| - Logical OR
! - Logical NOT
5) Explain ternary operator
in C.
The ternary opearor is also known as Conditional
opearator. Syntax:
(expr 1) ? (expr-2) : expr-3)
The expr-1 is evaluated first. If it is true, the expr-2 is
evaluated and it is the value of expr-1 . If expr-1 is
false, expr-3 is evaluated and it is the value for expr-
1
Example for Ternary
Operator
Example:
A=10
B= 15
Max =(A>B )? A : B
6) What is the use of
decision making statement?
Decision making statement is used to break the normal
flow of the program and execute another part of the
program based on some condition.
7) List the various decision
making statements
available in C ?
1. If statement
2. If ..else statement.
3. Nested if statement
4. If ..else ladder statement
5. Switch statement
8) Write the program logic
to find biggest among three
without using ” , =”
return (a>b) ? (a>c ? a:c) : (b>c ? b: c)
9) What are the various
looping statements
available in C?
a) While statement
b) Do..while statement
c) For statement
10) What is the difference
between while and do..while
statement?
* While is an entry controlled statement. The
statements inside the while may not be executed at
all when the condition becomes false at the first
attempt itself.
* The do..while is an exit controlled statement. The
statements in the block are executed at least once.
11) What is an array?
* An array is a collection of data of same data type.
* The elements of the array are stored in consecutive
memory locations.
* The array elements can be accessed using an integer
called index.
12) What is the starting
index of an array in ‘C’?
The starting index of an array in ‘C’ is 0.
13) What are the types of
array?
One dimensional array
Two dimensional array
Multidimensional array.
14) What is a two
dimensional array?
Two dimensional array is an array of two dimension –
rows and columns. The elements in this array are
referenced with the help of its row and column
index.
15) What are the
advantages of using
functions in a C program?
* Debugging is easier
* It is easier to understand the logic involved in the
program
* Testing is easier
* Recursive call is possible
* Irrelevant details from the user's point of view (i.e.,
the code) are hidden from the users of a function
* Functions are helpful in generalizing the program
16) What is a function?
A function is a sub procedure that contains a set
ofstatements for performing a task. Functions reduce
the amount of work involved in reusing some code.
They are normally called from the main part of the
program (main()) for their execution.
17) Write the syntax of the
function definition.
return-value-type function-name( parameter-list )
{
declarations and statements
}
Elements of a Function:
–Function-name: any valid identifier
–Return-value-type: data type of the result (default
int). void – indicates that the function returns
nothing
–Parameter-list: comma separated list, declares
parameters. A type must be listed explicitly for each
parameter unless, the parameter is of type int
18) What is a recursive
function?
A function that calls itself is called a recursive
function.
19) What are the two
methods of function call?
Call by value
* Copy of argument is passed to function
* Changes in function do not reflect in actual
parameter
* Can be used when function does not need to modify
argument
* Helps us to avoid accidental changes in the actual
parameters
Method of Function Call
Call by reference
* Passes the reference (address) of the actual
parameter to the formal parameter
* Changes in function reflect in actual parameter
* Can be used only with trusted functions
20) What is the use of
return statement?
The return statement is used to exit from the callee
(called function) and return a value to its caller.

More Related Content

What's hot

Data types and operators in vb
Data types and operators  in vbData types and operators  in vb
Data types and operators in vballdesign
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++K Durga Prasad
 
Operators , Functions and Options in VB.NET
Operators , Functions and Options in VB.NETOperators , Functions and Options in VB.NET
Operators , Functions and Options in VB.NETShyam Sir
 
03 Operators and expressions
03 Operators and expressions03 Operators and expressions
03 Operators and expressionsmaznabili
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III TermAndrew Raj
 
Precedence and associativity (Computer programming and utilization)
Precedence and associativity (Computer programming and utilization)Precedence and associativity (Computer programming and utilization)
Precedence and associativity (Computer programming and utilization)Digvijaysinh Gohil
 
Evaluation of postfix expression
Evaluation of postfix expressionEvaluation of postfix expression
Evaluation of postfix expressionAkhil Ahuja
 
Variable, constant, operators and control statement
Variable, constant, operators and control statementVariable, constant, operators and control statement
Variable, constant, operators and control statementEyelean xilef
 
C programinng
C programinngC programinng
C programinngmahi1996
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c languagetanmaymodi4
 

What's hot (20)

Data types and operators in vb
Data types and operators  in vbData types and operators  in vb
Data types and operators in vb
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
Operators , Functions and Options in VB.NET
Operators , Functions and Options in VB.NETOperators , Functions and Options in VB.NET
Operators , Functions and Options in VB.NET
 
Misc Operator
Misc OperatorMisc Operator
Misc Operator
 
operators in c++
operators in c++operators in c++
operators in c++
 
03 Operators and expressions
03 Operators and expressions03 Operators and expressions
03 Operators and expressions
 
Method parameters in c#
Method parameters in c#Method parameters in c#
Method parameters in c#
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
 
Session 5-exersice
Session 5-exersiceSession 5-exersice
Session 5-exersice
 
Precedence and associativity (Computer programming and utilization)
Precedence and associativity (Computer programming and utilization)Precedence and associativity (Computer programming and utilization)
Precedence and associativity (Computer programming and utilization)
 
Evaluation of postfix expression
Evaluation of postfix expressionEvaluation of postfix expression
Evaluation of postfix expression
 
Assignment7
Assignment7Assignment7
Assignment7
 
Lecture 5
Lecture 5Lecture 5
Lecture 5
 
Chapter 2.datatypes and operators
Chapter 2.datatypes and operatorsChapter 2.datatypes and operators
Chapter 2.datatypes and operators
 
Variable, constant, operators and control statement
Variable, constant, operators and control statementVariable, constant, operators and control statement
Variable, constant, operators and control statement
 
C programinng
C programinngC programinng
C programinng
 
Operators
OperatorsOperators
Operators
 
Function in C Language
Function in C Language Function in C Language
Function in C Language
 
Assignment5
Assignment5Assignment5
Assignment5
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c language
 

Viewers also liked (20)

E tailing (Seminar Report)
E tailing (Seminar Report)E tailing (Seminar Report)
E tailing (Seminar Report)
 
Research Issues on WSN
Research Issues on WSNResearch Issues on WSN
Research Issues on WSN
 
Mobile Communication
Mobile CommunicationMobile Communication
Mobile Communication
 
Introduction to Bluetooth technology
Introduction to Bluetooth technologyIntroduction to Bluetooth technology
Introduction to Bluetooth technology
 
Mobile Communication
Mobile CommunicationMobile Communication
Mobile Communication
 
IT6601 MOBILE COMPUTING
IT6601 MOBILE COMPUTINGIT6601 MOBILE COMPUTING
IT6601 MOBILE COMPUTING
 
Wireless LAN Technoloy
Wireless LAN TechnoloyWireless LAN Technoloy
Wireless LAN Technoloy
 
Past, Present and Future of Mobile Computing
Past, Present and Future of Mobile ComputingPast, Present and Future of Mobile Computing
Past, Present and Future of Mobile Computing
 
Mobile Communication
Mobile CommunicationMobile Communication
Mobile Communication
 
IT6601 MOBILE COMPUTING
IT6601 MOBILE COMPUTINGIT6601 MOBILE COMPUTING
IT6601 MOBILE COMPUTING
 
Signals and Antennas in mobile computing
Signals and Antennas in mobile computingSignals and Antennas in mobile computing
Signals and Antennas in mobile computing
 
Mobile Communication
Mobile CommunicationMobile Communication
Mobile Communication
 
Mobile Communication
Mobile CommunicationMobile Communication
Mobile Communication
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Mobile and wireless computing
Mobile and wireless computingMobile and wireless computing
Mobile and wireless computing
 
IT6601 MOBILE COMPUTING
IT6601 MOBILE COMPUTINGIT6601 MOBILE COMPUTING
IT6601 MOBILE COMPUTING
 
IT6601 MOBILE COMPUTING
IT6601 MOBILE COMPUTINGIT6601 MOBILE COMPUTING
IT6601 MOBILE COMPUTING
 
Structure of a C program
Structure of a C programStructure of a C program
Structure of a C program
 
File handling in c
File handling in cFile handling in c
File handling in c
 

Similar to Frequently asked questions in c

c_programming.pdf
c_programming.pdfc_programming.pdf
c_programming.pdfHome
 
C++ Interview Question And Answer
C++ Interview Question And AnswerC++ Interview Question And Answer
C++ Interview Question And AnswerJagan Mohan Bishoyi
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answerlavparmar007
 
C basic questions&amp;ansrs by shiva kumar kella
C basic questions&amp;ansrs by shiva kumar kellaC basic questions&amp;ansrs by shiva kumar kella
C basic questions&amp;ansrs by shiva kumar kellaManoj Kumar kothagulla
 
1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answersAkash Gawali
 
Java apptitude-questions-part-1
Java apptitude-questions-part-1Java apptitude-questions-part-1
Java apptitude-questions-part-1vishvavidya
 
Fundamentals of c language
Fundamentals of c languageFundamentals of c language
Fundamentals of c languageAkshhayPatel
 
Complicated declarations in c
Complicated declarations in cComplicated declarations in c
Complicated declarations in cRahul Budholiya
 
Functions in c language
Functions in c language Functions in c language
Functions in c language tanmaymodi4
 
Functions in c language
Functions in c languageFunctions in c language
Functions in c languageTanmay Modi
 
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdfUSER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdfSowmyaJyothi3
 

Similar to Frequently asked questions in c (20)

Programming in c by pkv
Programming in c by pkvProgramming in c by pkv
Programming in c by pkv
 
c_programming.pdf
c_programming.pdfc_programming.pdf
c_programming.pdf
 
C++ Interview Question And Answer
C++ Interview Question And AnswerC++ Interview Question And Answer
C++ Interview Question And Answer
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answer
 
C program
C programC program
C program
 
C material
C materialC material
C material
 
Unit 1
Unit 1Unit 1
Unit 1
 
C basic questions&amp;ansrs by shiva kumar kella
C basic questions&amp;ansrs by shiva kumar kellaC basic questions&amp;ansrs by shiva kumar kella
C basic questions&amp;ansrs by shiva kumar kella
 
1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers
 
Java apptitude-questions-part-1
Java apptitude-questions-part-1Java apptitude-questions-part-1
Java apptitude-questions-part-1
 
Fundamentals of c language
Fundamentals of c languageFundamentals of c language
Fundamentals of c language
 
Unit-III.pptx
Unit-III.pptxUnit-III.pptx
Unit-III.pptx
 
Complicated declarations in c
Complicated declarations in cComplicated declarations in c
Complicated declarations in c
 
Design & Analysis Of Algorithm
Design & Analysis Of AlgorithmDesign & Analysis Of Algorithm
Design & Analysis Of Algorithm
 
Functions in c language
Functions in c language Functions in c language
Functions in c language
 
Functions in c language
Functions in c languageFunctions in c language
Functions in c language
 
Pc module1
Pc module1Pc module1
Pc module1
 
arrays.ppt
arrays.pptarrays.ppt
arrays.ppt
 
PSPC-UNIT-4.pdf
PSPC-UNIT-4.pdfPSPC-UNIT-4.pdf
PSPC-UNIT-4.pdf
 
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdfUSER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
 

Recently uploaded

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 

Recently uploaded (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

Frequently asked questions in c

  • 1. Frequently Asked Questions in C!  Developed by David Livingsto J, Coimbatore  Contact email: davidjlivingston@gmail.com  Blogs maintained by the author includees:  futureforyou.net  futureforyou.biz
  • 2. 1. List out the various arithmetic operators in C? + Addition - Subtraction * Multiplication / Divison % Modulo Division
  • 3. 2. What is an arithmetic expression? An arithmetic expression is a combination arithmetic operators and operands of type integer.
  • 4. 3) What are the various relational operators in C? < Less than > Greater than = Equal != Not equal >= Greater than or equal to <= Lesser than or equal to
  • 5. 4) Write the various logical operators in C? && - Logical AND || - Logical OR ! - Logical NOT
  • 6. 5) Explain ternary operator in C. The ternary opearor is also known as Conditional opearator. Syntax: (expr 1) ? (expr-2) : expr-3) The expr-1 is evaluated first. If it is true, the expr-2 is evaluated and it is the value of expr-1 . If expr-1 is false, expr-3 is evaluated and it is the value for expr- 1
  • 8. 6) What is the use of decision making statement? Decision making statement is used to break the normal flow of the program and execute another part of the program based on some condition.
  • 9. 7) List the various decision making statements available in C ? 1. If statement 2. If ..else statement. 3. Nested if statement 4. If ..else ladder statement 5. Switch statement
  • 10. 8) Write the program logic to find biggest among three without using ” , =” return (a>b) ? (a>c ? a:c) : (b>c ? b: c)
  • 11. 9) What are the various looping statements available in C? a) While statement b) Do..while statement c) For statement
  • 12. 10) What is the difference between while and do..while statement? * While is an entry controlled statement. The statements inside the while may not be executed at all when the condition becomes false at the first attempt itself. * The do..while is an exit controlled statement. The statements in the block are executed at least once.
  • 13. 11) What is an array? * An array is a collection of data of same data type. * The elements of the array are stored in consecutive memory locations. * The array elements can be accessed using an integer called index.
  • 14. 12) What is the starting index of an array in ‘C’? The starting index of an array in ‘C’ is 0.
  • 15. 13) What are the types of array? One dimensional array Two dimensional array Multidimensional array.
  • 16. 14) What is a two dimensional array? Two dimensional array is an array of two dimension – rows and columns. The elements in this array are referenced with the help of its row and column index.
  • 17. 15) What are the advantages of using functions in a C program? * Debugging is easier * It is easier to understand the logic involved in the program * Testing is easier * Recursive call is possible * Irrelevant details from the user's point of view (i.e., the code) are hidden from the users of a function * Functions are helpful in generalizing the program
  • 18. 16) What is a function? A function is a sub procedure that contains a set ofstatements for performing a task. Functions reduce the amount of work involved in reusing some code. They are normally called from the main part of the program (main()) for their execution.
  • 19. 17) Write the syntax of the function definition. return-value-type function-name( parameter-list ) { declarations and statements }
  • 20. Elements of a Function: –Function-name: any valid identifier –Return-value-type: data type of the result (default int). void – indicates that the function returns nothing –Parameter-list: comma separated list, declares parameters. A type must be listed explicitly for each parameter unless, the parameter is of type int
  • 21. 18) What is a recursive function? A function that calls itself is called a recursive function.
  • 22. 19) What are the two methods of function call? Call by value * Copy of argument is passed to function * Changes in function do not reflect in actual parameter * Can be used when function does not need to modify argument * Helps us to avoid accidental changes in the actual parameters
  • 23. Method of Function Call Call by reference * Passes the reference (address) of the actual parameter to the formal parameter * Changes in function reflect in actual parameter * Can be used only with trusted functions
  • 24. 20) What is the use of return statement? The return statement is used to exit from the callee (called function) and return a value to its caller.