SlideShare une entreprise Scribd logo
1  sur  22
Q.1: What is C language
    in your opinion?
 Developed by Dennis Ritchie
 between 1969 & 1973.
 Developed at the Bell
 Laboratories, aimed to use with
 UNIX OS.
 Widely used for developing
 application software, though it
 was mainly invented for
 developing system software.
Q.2: What is a static
variable in context of C
      language?
 Declared inside a function.


 Declared for function name.


 Declared for Global parameters.
Q.3: Can you explain the
 difference between a
 normal variable and a
        pointer?
 A normal variable can have any value

 and can be changed throughout the
 length of the program.


 A pointer defines the address where

 another variable is stored and not any
 value.
Q.4: What is the
     difference
between calloc() and
     malloc()?
 malloc() will create single block of memory of
  size specified by the user.
 Example - p=(int*)malloc(sizeof(int)*5)


 calloc() takes two arguments and zero initializes
  the memory. It can assign multiple blocks of
  memory for a variable.
 Example - p=(int*)calloc(5,sizeof(int)*5)
Q.5: What is the
difference between printf()
       and sprint()?
 Printf() outputs the data to the standard

 output device which is usually the
 computer monitor.
 Sprint() outputs the data to a character

 array.
Q.6: Which is the fastest
sorting method you can
use while programming in
c language?
This is a question which falls into “There is no
one-size-fits-all answer” category. But few
options are-

 Quick sort.
 Radix sort.
 Merge sort.
Q.7: Is using functions or
  macros better when
  programming in C?
 Macros are generally more efficient and
 faster.

 Macros cannot handle complex programming
 constructs and in such cases functions are
 used

 We can choose macros or functions based on
 our priority - speed vs. size of program.
Q.8: What is a Stack?
 Stack is where information required to call

 and return function resides
 It also stores a functions local variable

 Stack follows a FIFO model
Q.9: What is the
difference between C and
           C++?
 C++ is an advanced version of C which
 introduced a lot of new features like
 classes and so on.

 It’s much more object oriented compared to
 the general purpose programming C was
 initially created for.
Q.10: Is it good to use
goto statement?
 goto statements are used to implement a
 local jump during program execution.

 It is not considered a good practice to use
 goto statements and should be avoided as
 much as possible.
For more C++ gyan, log on
           to-
    YourNextLeap.com

Contenu connexe

Tendances (20)

C++ Function
C++ FunctionC++ Function
C++ Function
 
Dynamic memory allocation in c
Dynamic memory allocation in cDynamic memory allocation in c
Dynamic memory allocation in c
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Language
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
 
C language unit-1
C language unit-1C language unit-1
C language unit-1
 
Function lecture
Function lectureFunction lecture
Function lecture
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++
 
Polymorphism in c++(ppt)
Polymorphism in c++(ppt)Polymorphism in c++(ppt)
Polymorphism in c++(ppt)
 
Intro to c++
Intro to c++Intro to c++
Intro to c++
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
C++ Language
C++ LanguageC++ Language
C++ Language
 
Functions in C
Functions in CFunctions in C
Functions in C
 
C++ Programming Language
C++ Programming Language C++ Programming Language
C++ Programming Language
 
C++ Overview PPT
C++ Overview PPTC++ Overview PPT
C++ Overview PPT
 
C++ programming
C++ programmingC++ programming
C++ programming
 
Java interfaces
Java interfacesJava interfaces
Java interfaces
 
C# programming language
C# programming languageC# programming language
C# programming language
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops concepts
 
Virtual function in C++ Pure Virtual Function
Virtual function in C++ Pure Virtual Function Virtual function in C++ Pure Virtual Function
Virtual function in C++ Pure Virtual Function
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
 

En vedette

Embedded SW Interview Questions
Embedded SW Interview Questions Embedded SW Interview Questions
Embedded SW Interview Questions PiTechnologies
 
Insecure coding in C (and C++)
Insecure coding in C (and C++)Insecure coding in C (and C++)
Insecure coding in C (and C++)Olve Maudal
 
Java questions for viva
Java questions for vivaJava questions for viva
Java questions for vivaVipul Naik
 
Top 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and AnswersTop 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and Answersiimjobs and hirist
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointJavaTpoint.Com
 
Basic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a jobBasic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a jobGaruda Trainings
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShareSlideShare
 
C interview question answer 2
C interview question answer 2C interview question answer 2
C interview question answer 2Amit Kapoor
 
C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1ReKruiTIn.com
 
Very interesting C programming Technical Questions
Very interesting C programming Technical Questions Very interesting C programming Technical Questions
Very interesting C programming Technical Questions Vanathi24
 
Tangible User Interface: Research investigation and exploration
Tangible User Interface: Research investigation and explorationTangible User Interface: Research investigation and exploration
Tangible User Interface: Research investigation and explorationIndiana University
 
Current affairs (2011)
Current affairs (2011)Current affairs (2011)
Current affairs (2011)Wai-Kwok Wong
 
New media and current affairs
New media and current affairsNew media and current affairs
New media and current affairsSanjana Hattotuwa
 
Reasoning and mental aptitude for entrance test1
Reasoning and mental aptitude for entrance test1Reasoning and mental aptitude for entrance test1
Reasoning and mental aptitude for entrance test1Dr. Trilok Kumar Jain
 

En vedette (17)

Embedded SW Interview Questions
Embedded SW Interview Questions Embedded SW Interview Questions
Embedded SW Interview Questions
 
Insecure coding in C (and C++)
Insecure coding in C (and C++)Insecure coding in C (and C++)
Insecure coding in C (and C++)
 
Deep C
Deep CDeep C
Deep C
 
Java questions for viva
Java questions for vivaJava questions for viva
Java questions for viva
 
Top 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and AnswersTop 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and Answers
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpoint
 
Basic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a jobBasic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a job
 
Eli Lilly Scholarship for BDPA Students (2017)
Eli Lilly Scholarship for BDPA Students (2017)Eli Lilly Scholarship for BDPA Students (2017)
Eli Lilly Scholarship for BDPA Students (2017)
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
 
C interview question answer 2
C interview question answer 2C interview question answer 2
C interview question answer 2
 
C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1
 
Very interesting C programming Technical Questions
Very interesting C programming Technical Questions Very interesting C programming Technical Questions
Very interesting C programming Technical Questions
 
Tangible User Interface: Research investigation and exploration
Tangible User Interface: Research investigation and explorationTangible User Interface: Research investigation and exploration
Tangible User Interface: Research investigation and exploration
 
Resume dinesh updated
Resume dinesh updatedResume dinesh updated
Resume dinesh updated
 
Current affairs (2011)
Current affairs (2011)Current affairs (2011)
Current affairs (2011)
 
New media and current affairs
New media and current affairsNew media and current affairs
New media and current affairs
 
Reasoning and mental aptitude for entrance test1
Reasoning and mental aptitude for entrance test1Reasoning and mental aptitude for entrance test1
Reasoning and mental aptitude for entrance test1
 

Similaire à C programming interview questions

Cprogramminginterviewquestions 120622074544-phpapp01
Cprogramminginterviewquestions 120622074544-phpapp01Cprogramminginterviewquestions 120622074544-phpapp01
Cprogramminginterviewquestions 120622074544-phpapp01chandu_microcosm
 
Frequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answersFrequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answersnishajj
 
C interview questions
C interview questionsC interview questions
C interview questionsSoba Arjun
 
Unit 1 of c++ part 1 basic introduction
Unit 1 of c++ part 1 basic introductionUnit 1 of c++ part 1 basic introduction
Unit 1 of c++ part 1 basic introductionAKR Education
 
Bca1020 programming in c
Bca1020  programming in cBca1020  programming in c
Bca1020 programming in csmumbahelp
 
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...NicheTech Com. Solutions Pvt. Ltd.
 
A Case Study Of A Reusable Component Collection
A Case Study Of A Reusable Component CollectionA Case Study Of A Reusable Component Collection
A Case Study Of A Reusable Component CollectionJennifer Strong
 
Bca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroductionBca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroductionRai University
 
Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)
Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)
Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)Farwa Ansari
 
Mca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroductionMca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroductionRai University
 
C basic questions&ansrs by shiva kumar kella
C basic questions&ansrs by shiva kumar kellaC basic questions&ansrs by shiva kumar kella
C basic questions&ansrs by shiva kumar kellaManoj Kumar kothagulla
 
Migrating From Cpp To C Sharp
Migrating From Cpp To C SharpMigrating From Cpp To C Sharp
Migrating From Cpp To C SharpGanesh Samarthyam
 
Realtime selenium interview questions
Realtime selenium interview questionsRealtime selenium interview questions
Realtime selenium interview questionsKuldeep Pawar
 
Top interview questions in c
Top interview questions in cTop interview questions in c
Top interview questions in cAvinash Seth
 
Frequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answersFrequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answersnishajj
 
A Program Transformation Technique To Support AOP Within C Template
A Program Transformation Technique To Support AOP Within C   TemplateA Program Transformation Technique To Support AOP Within C   Template
A Program Transformation Technique To Support AOP Within C TemplateCrystal Sanchez
 
CS8251_QB_answers.pdf
CS8251_QB_answers.pdfCS8251_QB_answers.pdf
CS8251_QB_answers.pdfvino108206
 
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018Steven Smith
 

Similaire à C programming interview questions (20)

Cprogramminginterviewquestions 120622074544-phpapp01
Cprogramminginterviewquestions 120622074544-phpapp01Cprogramminginterviewquestions 120622074544-phpapp01
Cprogramminginterviewquestions 120622074544-phpapp01
 
Frequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answersFrequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answers
 
Shuzworld Analysis
Shuzworld AnalysisShuzworld Analysis
Shuzworld Analysis
 
C interview questions
C interview questionsC interview questions
C interview questions
 
Unit 1 of c++ part 1 basic introduction
Unit 1 of c++ part 1 basic introductionUnit 1 of c++ part 1 basic introduction
Unit 1 of c++ part 1 basic introduction
 
ewili13_submission_14
ewili13_submission_14ewili13_submission_14
ewili13_submission_14
 
Bca1020 programming in c
Bca1020  programming in cBca1020  programming in c
Bca1020 programming in c
 
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
 
A Case Study Of A Reusable Component Collection
A Case Study Of A Reusable Component CollectionA Case Study Of A Reusable Component Collection
A Case Study Of A Reusable Component Collection
 
Bca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroductionBca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroduction
 
Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)
Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)
Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)
 
Mca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroductionMca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroduction
 
C basic questions&ansrs by shiva kumar kella
C basic questions&ansrs by shiva kumar kellaC basic questions&ansrs by shiva kumar kella
C basic questions&ansrs by shiva kumar kella
 
Migrating From Cpp To C Sharp
Migrating From Cpp To C SharpMigrating From Cpp To C Sharp
Migrating From Cpp To C Sharp
 
Realtime selenium interview questions
Realtime selenium interview questionsRealtime selenium interview questions
Realtime selenium interview questions
 
Top interview questions in c
Top interview questions in cTop interview questions in c
Top interview questions in c
 
Frequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answersFrequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answers
 
A Program Transformation Technique To Support AOP Within C Template
A Program Transformation Technique To Support AOP Within C   TemplateA Program Transformation Technique To Support AOP Within C   Template
A Program Transformation Technique To Support AOP Within C Template
 
CS8251_QB_answers.pdf
CS8251_QB_answers.pdfCS8251_QB_answers.pdf
CS8251_QB_answers.pdf
 
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
 

Dernier

Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 

Dernier (20)

Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 

C programming interview questions

  • 1.
  • 2. Q.1: What is C language in your opinion?
  • 3.  Developed by Dennis Ritchie between 1969 & 1973.  Developed at the Bell Laboratories, aimed to use with UNIX OS.  Widely used for developing application software, though it was mainly invented for developing system software.
  • 4. Q.2: What is a static variable in context of C language?
  • 5.  Declared inside a function.  Declared for function name.  Declared for Global parameters.
  • 6. Q.3: Can you explain the difference between a normal variable and a pointer?
  • 7.  A normal variable can have any value and can be changed throughout the length of the program.  A pointer defines the address where another variable is stored and not any value.
  • 8. Q.4: What is the difference between calloc() and malloc()?
  • 9.  malloc() will create single block of memory of size specified by the user.  Example - p=(int*)malloc(sizeof(int)*5)  calloc() takes two arguments and zero initializes the memory. It can assign multiple blocks of memory for a variable.  Example - p=(int*)calloc(5,sizeof(int)*5)
  • 10. Q.5: What is the difference between printf() and sprint()?
  • 11.  Printf() outputs the data to the standard output device which is usually the computer monitor.  Sprint() outputs the data to a character array.
  • 12. Q.6: Which is the fastest sorting method you can use while programming in c language?
  • 13. This is a question which falls into “There is no one-size-fits-all answer” category. But few options are-  Quick sort.  Radix sort.  Merge sort.
  • 14. Q.7: Is using functions or macros better when programming in C?
  • 15.  Macros are generally more efficient and faster.  Macros cannot handle complex programming constructs and in such cases functions are used  We can choose macros or functions based on our priority - speed vs. size of program.
  • 16. Q.8: What is a Stack?
  • 17.  Stack is where information required to call and return function resides  It also stores a functions local variable  Stack follows a FIFO model
  • 18. Q.9: What is the difference between C and C++?
  • 19.  C++ is an advanced version of C which introduced a lot of new features like classes and so on.  It’s much more object oriented compared to the general purpose programming C was initially created for.
  • 20. Q.10: Is it good to use goto statement?
  • 21.  goto statements are used to implement a local jump during program execution.  It is not considered a good practice to use goto statements and should be avoided as much as possible.
  • 22. For more C++ gyan, log on to- YourNextLeap.com