SlideShare a Scribd company logo
1 of 6
1. What is C Language?
 The first programming language ever created, C, is a procedural programming language. It was
developed by Dennis Ritchie as an operating system programming language. Because of its structure,
high-level abstraction, machine independence, and other features, it is one of the most widely used
programming languages and a fantastic place to start for anyone interested in learning how to code.
2. What is the use of printf() and scanf() functions? Also explain format specifiers?
 printf() is used to print the output on the display.
 scanf() is used to read formatted data from the keyboard.
 Some datatype format specifiers for both printing and scanning purposes are as
follows:
 %d: It's a datatype format specifier for printing and scanning an integer value.
 %s: It's a datatype format specifier for printing and scanning a string.
 %c: It's a datatype format specifier for displaying and scanning a character
value.
 %f: The datatype format specifier %f is used to display and scan a float value.
3. What is a built-in function in C?
 Built-in functionality, usually referred to as library functions, is a convenience feature offered by
the system that helps developers complete a number of frequently performed predefined activities.
For instance, in C, we use printf() to print output or our programme into the terminal.
4. What is an r-value and l-value?
 A data value that is kept in memory at a specific location is referred to as a "r-value". A value
cannot be assigned to an expression that has an r-value, hence this expression can only occur on the
right side of the assignment operator (=).
 The phrase "l-value" describes a memory address that is used to identify an object. Either the
left or right side of the assignment operator (=) contains the l-value. In many cases, l-value is utilised
as an identification.
5. What is Dynamic memory allocation in C? Name the dynamic allocation
functions?
 C is a language known for its low-level control over the memory allocation of
variables in DMA there are two major standard library malloc() and free. The malloc()
function takes a single input parameter which tells the size of the memory requested It
returns a pointer to the allocated memory. If the allocation fails, it returns NULL. The
prototype for the standard library function is like this:
 void *malloc(size_t size);
The free() function takes the pointer returned by malloc() and de-allocates the
memory. No indication of success or failure is returned. The function prototype is like
this:
 void free(void *pointer);
There are 4 library functions provided by C defined under <stdlib.h> header file to
facilitate dynamic memory allocation in C programming. They are:
 malloc()
 calloc()
 free()
 realloc()
6. What is the difference between #include "..." and #include <...>?
 The C preprocessor initially checks the predefined list of system directories for
the filename for #include filename> before checking the user-specified directories
(directories can be added to the predetermined list using the -I option).
 The preprocessor searches for #include "filename" in the same directory as the file containing
the directive first, then uses the same search path as for the #include filename> form. This approach is
typically used to include header files that are defined by programmes.
7. What is call by reference in functions?
 Call by reference is the term used when the calling function calls a function
without using the addresses of the actual parameters being given. Because all actions
in incall by reference are conducted on the value stored in the address of real
parameters, each operation made on formal parameters has an impact on the value of
actual parameters.
8. What is a near pointer and a far pointer in C?
 Near Pointer: The near pointer, which can hold an address with a maximum size
of only 16 bits, is generally regarded. The close pointer cannot be used to store an
address with a size greater than 16 bits. The 16-bit limit does not apply to any other
smaller addresses, therefore they can all be saved. You might suppose the 16 bits are
insufficient given that we can only read 64kb of data at once. It is no longer widely
employed because it is thought to be one of the near-pointer's main shortcomings.
 Far pointer: A 32-bit pointer is regarded as being a far pointer. However, it can
make use of the current segment to access data kept outside of the computer's
memory. Although we typically need to allocate the sector register to store the data
address in the current segment in order to use this type of pointer.
9. Which structure is used to link the program and the operating system?
 The operating system and a programme are joined by the file structure. The file is
defined by the "stdio.h" header file (standard input/output header file). It includes
details about the file now being used, including its size and placement in memory. It
includes a character pointer that directs the user to the character that is currently open.
When a file is opened, a connection is made between the programme and the operating
system so that they know which file will be accessed.
10 - Which is better #define or enum?
 The compiler has the ability to create enum values automatically if we let it. The
defined values must all be provided separately, though.
 The source code is not aware of these macros because they are preprocessors rather
than enums, which are compile-time entities. The enum is therefore preferable if we debug
the function with a debugger.
 If we utilise enum values in a switch and the default case is absent, some compilers will
issue a warning.
 Enum always produces identifiers of the int type. On the other hand, the macro gave us
the option to select among a number of integral types.
 The macro lacks a clearly known scope constraint, unlike enum.
11- How do you override a defined macro?
 The #ifdef and #undef preprocessors can be used as follows to replace a declared
macro:
 #ifdef A
 #undef A
 #endif
 #define A 10
 If macro A is defined, it will be undefined using undef and then defined again using
define
12- What is dynamic data structure?
 A dynamic data structure (DDS) is an arrangement or grouping of data in memory that
can expand or contract in size, giving a programmer complete control over how much
memory is used. As needed, unused memory from the heap is allocated or de-allocated to
adjust the size of dynamic data structures.
 Programming languages like C, C++, and Java rely heavily on dynamic data structures
because they provide programmers the freedom to control how much memory a programme
uses.
13-Escape Sequence in C
 The characters or sequence of characters that can be used inside a string literal in C are
known as the escape sequence. The characters that can't be typed regularly using the
keyboard are represented by the escape sequence. Some escape sequence symbols are
included in the ASCII charset, whereas others are not.

 Characters are represented by different escape sequences, however the result depends
on the compiler you're running.
14- Function Prototype in C
 The C function prototype is a statement that provides information to the compiler
about the function's name, return type, parameter values, and data types. The compiler
compares the data type of function parameters with the function declaration and function
call using this information.

 Function prototypes function similarly to function declarations in that they are optional
if the function definition appears in the programme before the function call, but obligatory if
the function reference or call appears before.

15 – what are C/C++ Preprocessors
 Programmes called preprocessors are used to clean up source code before compilation.
In C/C++, there are several phases between writing a programme and running it. Before we
begin learning about preprocessors, let's have a look at these stages.
 To instruct the compiler to preprocess the source code before compiling, preprocessor
programmes offer preprocessor directives. The '#' (hash) sign is used at the start of each of
these preprocessor directives. The '#' symbol denotes that the preprocessor programme will
be used to execute any statement that begins with a '#'. These preprocessor directives can be
inserted anywhere in our programme.
16 - What do you mean by Dangling Pointer Variable in C Programming?
 In C programming, a pointer is used to identify a variable's location in memory. The term
"dangling pointer variable" refers to a pointer variable that has been erased yet the pointer is
still referring to the same position in memory.
17 - Differentiate between calloc() and malloc()
 The memory dynamic memory allocating routines calloc() and malloc(). The sole
distinction between them is that malloc() will not load a value into any of the designated
memory addresses, but calloc() would.
18 - How can we store a negative integer?
 The procedures below must be taken in order to store a negative integer. Calculate the
same positive integer's two's complement.
 Eg: 1011 (-5)
 One's complement of 5 in Step 1 is 1010.
 Step 2: Adding 1 to the above resulted in 1011, which is -5.
19 - Differentiate between Actual Parameters and Formal Parameters.
 Actual parameters are those that are transmitted from the main function to the
subdivided function, while formal parameters are those that are specified at the subdivided
function conclusion.
20 - What is a C Token?
 C Tokens are any keywords, constants, special symbols, strings, operators, or identifiers
used in a C programme.
21- What are the limitations of scanf() and how can it be avoided?
 The following are scanf()'s restrictions:

 The character string prevents scanf() from working.
 The scanf() function cannot be used to insert a multiword string into a single variable.
 The gets() method is utilised to prevent this.
 When the enter key is pushed, it is terminated after receiving a string from the keyboard.
 The input string in this case is permissible to contain spaces and tabs.

22 - Why is C called the Mother of all Languages?
 Arrays, lists, functions, strings, and other fundamental concepts and data structures
were introduced in C. The C language serves as the foundation for many other languages. As a
result, it is regarded as the origin of all languages.

23 - What is the purpose of printf() and scanf() in C Program?
 printf() is used to print the values on the screen. To print certain values, and on
the other hand, scanf() is used to scan the values. We need an appropriate datatype
format specifier for both printing and scanning purposes. For example,
 %d: It is a datatype format specifier used to print and scan an integer value.
 %s: It is a datatype format specifier used to print and scan a string.
 %c: It is a datatype format specifier used to display and scan a character value.
 %f: It is a datatype format specifier used to display and scan a float value.
24 - What is the main difference between the Compiler and the Interpreter?
 The C language uses a compiler, which instantly converts the entire programme into
machine code. On the other hand, high-end programming languages like Java and others
require interpreters. Line by line code compilation is how it is intended to work.
25 - Explain the # pragma directive.
 The Pragma Directive is explained in the following sentences.
 This preprocessor directive can be used to enable or disable specific functionalities.
 There are three different kinds: pragma startup, pragma exit, and pragma warn.
 We can specify the functions called upon programme startup using the #pragma startup
command.
 We can specify functions called upon programme exit using the #pragma exit command.
 #pragma warn instructs the computer whether or not to suppress any warnings.
26 - Which structure is used to link the program and the operating system?
 The following examples provide an explanation for the response:
 File is the framework that connects the operating system and a programme.
 The header file "stdio.h" (standard input/output header file) contains a definition for the file.
 It includes details about the file now being used, including its size and placement in memory.
 It has a character pointer that directs attention to the character being opened.
 The operating system and the programme are informed which file is to be accessed when a file
is opened.

27 - What is the code in a while loop that returns the output of the given code ?
 #include <stdio.h>

 int main () {

 int a;

 /* for loop execution */
 for( a = 1; a <= 100; a++ )
 {
 printf("%dn",a * a);
 }

 return 0;
 }
28 - What is the explanation for modular programming?
 Module programming is the process of breaking up the main programme into
executable sections. This idea encourages reusability.
29 - What are the ways to a null pointer that can be used in the C programming
language?
 There are three ways to use null pointers.

 as a value for errors.
 as an indicator value.
 to stop the recursive data structure from being indirect.
30 - What is indirection?
 There is no direct reference to the value of the variable if you have defined a pointer to
it or any other memory object. The indirect reference is what it is called. However, a variable
has a direct reference to its value when it is declared.

More Related Content

Similar to interview questions.docx

C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1ReKruiTIn.com
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1SURBHI SAROHA
 
Interview Questions For C Language .pptx
Interview Questions For C Language .pptxInterview Questions For C Language .pptx
Interview Questions For C Language .pptxRowank2
 
C programming course material
C programming course materialC programming course material
C programming course materialRanjitha Murthy
 
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptx
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptxIIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptx
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptxrajkumar490591
 
Interview Questions For C Language
Interview Questions For C Language Interview Questions For C Language
Interview Questions For C Language Rowank2
 
C and CPP Interview Questions
C and CPP Interview QuestionsC and CPP Interview Questions
C and CPP Interview QuestionsSagar Joshi
 
Book management system
Book management systemBook management system
Book management systemSHARDA SHARAN
 
Buffer overflow tutorial
Buffer overflow tutorialBuffer overflow tutorial
Buffer overflow tutorialhughpearse
 
Unit 2 introduction to c programming
Unit 2   introduction to c programmingUnit 2   introduction to c programming
Unit 2 introduction to c programmingMithun DSouza
 
C language introduction geeksfor geeks
C language introduction   geeksfor geeksC language introduction   geeksfor geeks
C language introduction geeksfor geeksAashutoshChhedavi
 
Basic construction of c
Basic construction of cBasic construction of c
Basic construction of ckinish kumar
 
CS8251_QB_answers.pdf
CS8251_QB_answers.pdfCS8251_QB_answers.pdf
CS8251_QB_answers.pdfvino108206
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptxMugilvannan11
 
1. introduction to computer
1. introduction to computer1. introduction to computer
1. introduction to computerShankar Gangaju
 

Similar to interview questions.docx (20)

The smartpath information systems c pro
The smartpath information systems c proThe smartpath information systems c pro
The smartpath information systems c pro
 
C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1
 
Interview Questions For C Language .pptx
Interview Questions For C Language .pptxInterview Questions For C Language .pptx
Interview Questions For C Language .pptx
 
venkatesh.pptx
venkatesh.pptxvenkatesh.pptx
venkatesh.pptx
 
C programming course material
C programming course materialC programming course material
C programming course material
 
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptx
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptxIIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptx
IIM.Com-FIT-Unit2(14.9.2021 TO 30.9.2021).pptx
 
Interview Questions For C Language
Interview Questions For C Language Interview Questions For C Language
Interview Questions For C Language
 
C and CPP Interview Questions
C and CPP Interview QuestionsC and CPP Interview Questions
C and CPP Interview Questions
 
Book management system
Book management systemBook management system
Book management system
 
Buffer overflow tutorial
Buffer overflow tutorialBuffer overflow tutorial
Buffer overflow tutorial
 
Unit 2 introduction to c programming
Unit 2   introduction to c programmingUnit 2   introduction to c programming
Unit 2 introduction to c programming
 
C language introduction geeksfor geeks
C language introduction   geeksfor geeksC language introduction   geeksfor geeks
C language introduction geeksfor geeks
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Basic construction of c
Basic construction of cBasic construction of c
Basic construction of c
 
Pc module1
Pc module1Pc module1
Pc module1
 
CS8251_QB_answers.pdf
CS8251_QB_answers.pdfCS8251_QB_answers.pdf
CS8251_QB_answers.pdf
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptx
 
SRAVANByCPP
SRAVANByCPPSRAVANByCPP
SRAVANByCPP
 
1. introduction to computer
1. introduction to computer1. introduction to computer
1. introduction to computer
 

More from SeoTechnoscripts

Empower Your Embedded Future: Training at TechnoScripts
Empower Your Embedded Future: Training at TechnoScriptsEmpower Your Embedded Future: Training at TechnoScripts
Empower Your Embedded Future: Training at TechnoScriptsSeoTechnoscripts
 
Unlocking the Power of IoT: Revolutionizing Connectivity in Our World
Unlocking the Power of IoT: Revolutionizing Connectivity in Our WorldUnlocking the Power of IoT: Revolutionizing Connectivity in Our World
Unlocking the Power of IoT: Revolutionizing Connectivity in Our WorldSeoTechnoscripts
 
Mastering Embedded Systems: Empower Your Career with Technoscripts
Mastering Embedded Systems: Empower Your Career with TechnoscriptsMastering Embedded Systems: Empower Your Career with Technoscripts
Mastering Embedded Systems: Empower Your Career with TechnoscriptsSeoTechnoscripts
 
Empowering Tomorrow's Engineers: Embedded Training at Technoscripts
Empowering Tomorrow's Engineers: Embedded Training at TechnoscriptsEmpowering Tomorrow's Engineers: Embedded Training at Technoscripts
Empowering Tomorrow's Engineers: Embedded Training at TechnoscriptsSeoTechnoscripts
 

More from SeoTechnoscripts (7)

Empower Your Embedded Future: Training at TechnoScripts
Empower Your Embedded Future: Training at TechnoScriptsEmpower Your Embedded Future: Training at TechnoScripts
Empower Your Embedded Future: Training at TechnoScripts
 
Unlocking the Power of IoT: Revolutionizing Connectivity in Our World
Unlocking the Power of IoT: Revolutionizing Connectivity in Our WorldUnlocking the Power of IoT: Revolutionizing Connectivity in Our World
Unlocking the Power of IoT: Revolutionizing Connectivity in Our World
 
Mastering Embedded Systems: Empower Your Career with Technoscripts
Mastering Embedded Systems: Empower Your Career with TechnoscriptsMastering Embedded Systems: Empower Your Career with Technoscripts
Mastering Embedded Systems: Empower Your Career with Technoscripts
 
Empowering Tomorrow's Engineers: Embedded Training at Technoscripts
Empowering Tomorrow's Engineers: Embedded Training at TechnoscriptsEmpowering Tomorrow's Engineers: Embedded Training at Technoscripts
Empowering Tomorrow's Engineers: Embedded Training at Technoscripts
 
TECHNOSCRIPTS FAQ 2.docx
TECHNOSCRIPTS FAQ 2.docxTECHNOSCRIPTS FAQ 2.docx
TECHNOSCRIPTS FAQ 2.docx
 
learning STM -32
learning STM -32 learning STM -32
learning STM -32
 
STM -32
STM -32STM -32
STM -32
 

Recently uploaded

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
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
 
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
 
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
 
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
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
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
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 

Recently uploaded (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
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🔝
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
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
 
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
 
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
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
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
 
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
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 

interview questions.docx

  • 1. 1. What is C Language?  The first programming language ever created, C, is a procedural programming language. It was developed by Dennis Ritchie as an operating system programming language. Because of its structure, high-level abstraction, machine independence, and other features, it is one of the most widely used programming languages and a fantastic place to start for anyone interested in learning how to code. 2. What is the use of printf() and scanf() functions? Also explain format specifiers?  printf() is used to print the output on the display.  scanf() is used to read formatted data from the keyboard.  Some datatype format specifiers for both printing and scanning purposes are as follows:  %d: It's a datatype format specifier for printing and scanning an integer value.  %s: It's a datatype format specifier for printing and scanning a string.  %c: It's a datatype format specifier for displaying and scanning a character value.  %f: The datatype format specifier %f is used to display and scan a float value. 3. What is a built-in function in C?  Built-in functionality, usually referred to as library functions, is a convenience feature offered by the system that helps developers complete a number of frequently performed predefined activities. For instance, in C, we use printf() to print output or our programme into the terminal. 4. What is an r-value and l-value?  A data value that is kept in memory at a specific location is referred to as a "r-value". A value cannot be assigned to an expression that has an r-value, hence this expression can only occur on the right side of the assignment operator (=).  The phrase "l-value" describes a memory address that is used to identify an object. Either the left or right side of the assignment operator (=) contains the l-value. In many cases, l-value is utilised as an identification. 5. What is Dynamic memory allocation in C? Name the dynamic allocation functions?  C is a language known for its low-level control over the memory allocation of variables in DMA there are two major standard library malloc() and free. The malloc() function takes a single input parameter which tells the size of the memory requested It returns a pointer to the allocated memory. If the allocation fails, it returns NULL. The prototype for the standard library function is like this:  void *malloc(size_t size); The free() function takes the pointer returned by malloc() and de-allocates the memory. No indication of success or failure is returned. The function prototype is like this:  void free(void *pointer); There are 4 library functions provided by C defined under <stdlib.h> header file to facilitate dynamic memory allocation in C programming. They are:  malloc()  calloc()  free()
  • 2.  realloc() 6. What is the difference between #include "..." and #include <...>?  The C preprocessor initially checks the predefined list of system directories for the filename for #include filename> before checking the user-specified directories (directories can be added to the predetermined list using the -I option).  The preprocessor searches for #include "filename" in the same directory as the file containing the directive first, then uses the same search path as for the #include filename> form. This approach is typically used to include header files that are defined by programmes. 7. What is call by reference in functions?  Call by reference is the term used when the calling function calls a function without using the addresses of the actual parameters being given. Because all actions in incall by reference are conducted on the value stored in the address of real parameters, each operation made on formal parameters has an impact on the value of actual parameters. 8. What is a near pointer and a far pointer in C?  Near Pointer: The near pointer, which can hold an address with a maximum size of only 16 bits, is generally regarded. The close pointer cannot be used to store an address with a size greater than 16 bits. The 16-bit limit does not apply to any other smaller addresses, therefore they can all be saved. You might suppose the 16 bits are insufficient given that we can only read 64kb of data at once. It is no longer widely employed because it is thought to be one of the near-pointer's main shortcomings.  Far pointer: A 32-bit pointer is regarded as being a far pointer. However, it can make use of the current segment to access data kept outside of the computer's memory. Although we typically need to allocate the sector register to store the data address in the current segment in order to use this type of pointer. 9. Which structure is used to link the program and the operating system?  The operating system and a programme are joined by the file structure. The file is defined by the "stdio.h" header file (standard input/output header file). It includes details about the file now being used, including its size and placement in memory. It includes a character pointer that directs the user to the character that is currently open. When a file is opened, a connection is made between the programme and the operating system so that they know which file will be accessed. 10 - Which is better #define or enum?  The compiler has the ability to create enum values automatically if we let it. The defined values must all be provided separately, though.  The source code is not aware of these macros because they are preprocessors rather than enums, which are compile-time entities. The enum is therefore preferable if we debug the function with a debugger.  If we utilise enum values in a switch and the default case is absent, some compilers will issue a warning.  Enum always produces identifiers of the int type. On the other hand, the macro gave us the option to select among a number of integral types.
  • 3.  The macro lacks a clearly known scope constraint, unlike enum. 11- How do you override a defined macro?  The #ifdef and #undef preprocessors can be used as follows to replace a declared macro:  #ifdef A  #undef A  #endif  #define A 10  If macro A is defined, it will be undefined using undef and then defined again using define 12- What is dynamic data structure?  A dynamic data structure (DDS) is an arrangement or grouping of data in memory that can expand or contract in size, giving a programmer complete control over how much memory is used. As needed, unused memory from the heap is allocated or de-allocated to adjust the size of dynamic data structures.  Programming languages like C, C++, and Java rely heavily on dynamic data structures because they provide programmers the freedom to control how much memory a programme uses. 13-Escape Sequence in C  The characters or sequence of characters that can be used inside a string literal in C are known as the escape sequence. The characters that can't be typed regularly using the keyboard are represented by the escape sequence. Some escape sequence symbols are included in the ASCII charset, whereas others are not.   Characters are represented by different escape sequences, however the result depends on the compiler you're running. 14- Function Prototype in C  The C function prototype is a statement that provides information to the compiler about the function's name, return type, parameter values, and data types. The compiler compares the data type of function parameters with the function declaration and function call using this information.   Function prototypes function similarly to function declarations in that they are optional if the function definition appears in the programme before the function call, but obligatory if the function reference or call appears before.  15 – what are C/C++ Preprocessors  Programmes called preprocessors are used to clean up source code before compilation. In C/C++, there are several phases between writing a programme and running it. Before we begin learning about preprocessors, let's have a look at these stages.
  • 4.  To instruct the compiler to preprocess the source code before compiling, preprocessor programmes offer preprocessor directives. The '#' (hash) sign is used at the start of each of these preprocessor directives. The '#' symbol denotes that the preprocessor programme will be used to execute any statement that begins with a '#'. These preprocessor directives can be inserted anywhere in our programme. 16 - What do you mean by Dangling Pointer Variable in C Programming?  In C programming, a pointer is used to identify a variable's location in memory. The term "dangling pointer variable" refers to a pointer variable that has been erased yet the pointer is still referring to the same position in memory. 17 - Differentiate between calloc() and malloc()  The memory dynamic memory allocating routines calloc() and malloc(). The sole distinction between them is that malloc() will not load a value into any of the designated memory addresses, but calloc() would. 18 - How can we store a negative integer?  The procedures below must be taken in order to store a negative integer. Calculate the same positive integer's two's complement.  Eg: 1011 (-5)  One's complement of 5 in Step 1 is 1010.  Step 2: Adding 1 to the above resulted in 1011, which is -5. 19 - Differentiate between Actual Parameters and Formal Parameters.  Actual parameters are those that are transmitted from the main function to the subdivided function, while formal parameters are those that are specified at the subdivided function conclusion. 20 - What is a C Token?  C Tokens are any keywords, constants, special symbols, strings, operators, or identifiers used in a C programme. 21- What are the limitations of scanf() and how can it be avoided?  The following are scanf()'s restrictions:   The character string prevents scanf() from working.  The scanf() function cannot be used to insert a multiword string into a single variable.  The gets() method is utilised to prevent this.  When the enter key is pushed, it is terminated after receiving a string from the keyboard.  The input string in this case is permissible to contain spaces and tabs.  22 - Why is C called the Mother of all Languages?
  • 5.  Arrays, lists, functions, strings, and other fundamental concepts and data structures were introduced in C. The C language serves as the foundation for many other languages. As a result, it is regarded as the origin of all languages.  23 - What is the purpose of printf() and scanf() in C Program?  printf() is used to print the values on the screen. To print certain values, and on the other hand, scanf() is used to scan the values. We need an appropriate datatype format specifier for both printing and scanning purposes. For example,  %d: It is a datatype format specifier used to print and scan an integer value.  %s: It is a datatype format specifier used to print and scan a string.  %c: It is a datatype format specifier used to display and scan a character value.  %f: It is a datatype format specifier used to display and scan a float value. 24 - What is the main difference between the Compiler and the Interpreter?  The C language uses a compiler, which instantly converts the entire programme into machine code. On the other hand, high-end programming languages like Java and others require interpreters. Line by line code compilation is how it is intended to work. 25 - Explain the # pragma directive.  The Pragma Directive is explained in the following sentences.  This preprocessor directive can be used to enable or disable specific functionalities.  There are three different kinds: pragma startup, pragma exit, and pragma warn.  We can specify the functions called upon programme startup using the #pragma startup command.  We can specify functions called upon programme exit using the #pragma exit command.  #pragma warn instructs the computer whether or not to suppress any warnings. 26 - Which structure is used to link the program and the operating system?  The following examples provide an explanation for the response:  File is the framework that connects the operating system and a programme.  The header file "stdio.h" (standard input/output header file) contains a definition for the file.  It includes details about the file now being used, including its size and placement in memory.  It has a character pointer that directs attention to the character being opened.  The operating system and the programme are informed which file is to be accessed when a file is opened.  27 - What is the code in a while loop that returns the output of the given code ?  #include <stdio.h>   int main () {   int a; 
  • 6.  /* for loop execution */  for( a = 1; a <= 100; a++ )  {  printf("%dn",a * a);  }   return 0;  } 28 - What is the explanation for modular programming?  Module programming is the process of breaking up the main programme into executable sections. This idea encourages reusability. 29 - What are the ways to a null pointer that can be used in the C programming language?  There are three ways to use null pointers.   as a value for errors.  as an indicator value.  to stop the recursive data structure from being indirect. 30 - What is indirection?  There is no direct reference to the value of the variable if you have defined a pointer to it or any other memory object. The indirect reference is what it is called. However, a variable has a direct reference to its value when it is declared.