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
 
03 Operators and expressions
03 Operators and expressions03 Operators and expressions
03 Operators and expressionsmaznabili
 
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
 
Operator Precedence and Associativity
Operator Precedence and AssociativityOperator Precedence and Associativity
Operator Precedence and AssociativityNicole Ynne Estabillo
 
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
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III TermAndrew Raj
 
C Prog. - Operators and Expressions
C Prog. - Operators and ExpressionsC Prog. - Operators and Expressions
C Prog. - Operators and Expressionsvinay arora
 
Operators and expressions
Operators and expressionsOperators and expressions
Operators and expressionsvishaljot_kaur
 
Evaluation of postfix expression
Evaluation of postfix expressionEvaluation of postfix expression
Evaluation of postfix expressionAkhil Ahuja
 
CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++Pranav Ghildiyal
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c languagetanmaymodi4
 
Variable, constant, operators and control statement
Variable, constant, operators and control statementVariable, constant, operators and control statement
Variable, constant, operators and control statementEyelean xilef
 

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
 
Misc Operator
Misc OperatorMisc Operator
Misc Operator
 
03 Operators and expressions
03 Operators and expressions03 Operators and expressions
03 Operators and expressions
 
operators in c++
operators in c++operators in c++
operators in 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
 
Method parameters in c#
Method parameters in c#Method parameters in c#
Method parameters in c#
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Session 5-exersice
Session 5-exersiceSession 5-exersice
Session 5-exersice
 
Operator Precedence and Associativity
Operator Precedence and AssociativityOperator Precedence and Associativity
Operator Precedence and Associativity
 
Lecture 5
Lecture 5Lecture 5
Lecture 5
 
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)
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
 
Assignment7
Assignment7Assignment7
Assignment7
 
C Prog. - Operators and Expressions
C Prog. - Operators and ExpressionsC Prog. - Operators and Expressions
C Prog. - Operators and Expressions
 
Operators and expressions
Operators and expressionsOperators and expressions
Operators and expressions
 
Evaluation of postfix expression
Evaluation of postfix expressionEvaluation of postfix expression
Evaluation of postfix expression
 
CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c language
 
Function in C Language
Function in C Language Function in C Language
Function in C Language
 
Variable, constant, operators and control statement
Variable, constant, operators and control statementVariable, constant, operators and control statement
Variable, constant, operators and control statement
 

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
 
1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answersAkash Gawali
 
Complicated declarations in c
Complicated declarations in cComplicated declarations in c
Complicated declarations in cRahul Budholiya
 
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
 
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
 
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 program
C programC program
C program
 
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 material
C materialC material
C material
 
1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers
 
Unit 1
Unit 1Unit 1
Unit 1
 
Complicated declarations in c
Complicated declarations in cComplicated declarations in c
Complicated declarations in c
 
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
 
Unit-III.pptx
Unit-III.pptxUnit-III.pptx
Unit-III.pptx
 
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
 
Design & Analysis Of Algorithm
Design & Analysis Of AlgorithmDesign & Analysis Of Algorithm
Design & Analysis Of Algorithm
 
PSPC-UNIT-4.pdf
PSPC-UNIT-4.pdfPSPC-UNIT-4.pdf
PSPC-UNIT-4.pdf
 
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
 
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
 

More from David Livingston J

Performing Addition and Subtraction on Integers
Performing Addition and Subtraction on IntegersPerforming Addition and Subtraction on Integers
Performing Addition and Subtraction on IntegersDavid Livingston J
 
Introduction to Bluetooth technology
Introduction to Bluetooth technologyIntroduction to Bluetooth technology
Introduction to Bluetooth technologyDavid Livingston J
 
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 ComputingDavid Livingston J
 
Introduction & history of mobile computing
Introduction & history of mobile computingIntroduction & history of mobile computing
Introduction & history of mobile computingDavid Livingston J
 
Problem solving using Computer
Problem solving using ComputerProblem solving using Computer
Problem solving using ComputerDavid Livingston J
 

More from David Livingston J (8)

Performing Addition and Subtraction on Integers
Performing Addition and Subtraction on IntegersPerforming Addition and Subtraction on Integers
Performing Addition and Subtraction on Integers
 
Introduction to Bluetooth technology
Introduction to Bluetooth technologyIntroduction to Bluetooth technology
Introduction to Bluetooth technology
 
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
 
Introduction & history of mobile computing
Introduction & history of mobile computingIntroduction & history of mobile computing
Introduction & history of mobile computing
 
File handling in c
File handling in cFile handling in c
File handling in c
 
Structure of a C program
Structure of a C programStructure of a C program
Structure of a C program
 
Problem solving using Computer
Problem solving using ComputerProblem solving using Computer
Problem solving using Computer
 

Recently uploaded

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
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
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

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.