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 vb
alldesign
 
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
Shyam Sir
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
Andrew Raj
 
Variable, constant, operators and control statement
Variable, constant, operators and control statementVariable, constant, operators and control statement
Variable, constant, operators and control statement
Eyelean xilef
 
C programinng
C programinngC programinng
C programinng
mahi1996
 

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

Introduction to Bluetooth technology
Introduction to Bluetooth technologyIntroduction to Bluetooth technology
Introduction to Bluetooth technology
David 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 Computing
David Livingston J
 

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 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
Manoj Kumar kothagulla
 
Java apptitude-questions-part-1
Java apptitude-questions-part-1Java apptitude-questions-part-1
Java apptitude-questions-part-1
vishvavidya
 

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 languageFunctions in c language
Functions in c language
 
Functions in c language
Functions in c language Functions 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

Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 

Recently uploaded (20)

2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
How to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in PakistanHow to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in Pakistan
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.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.