<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>C - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/category/c/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/category/c/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Fri, 07 Oct 2022 09:23:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>C - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/category/c/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Difference Between malloc() and calloc()</title>
		<link>https://www.wikitechy.com/interview-questions/c/difference-between-malloc-and-calloc/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/difference-between-malloc-and-calloc/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Fri, 07 Oct 2022 09:22:19 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[calloc full form]]></category>
		<category><![CDATA[difference between malloc and calloc functions]]></category>
		<category><![CDATA[difference between malloc and calloc in c]]></category>
		<category><![CDATA[difference between malloc and calloc with example]]></category>
		<category><![CDATA[Difference Between malloc() and calloc()]]></category>
		<category><![CDATA[Difference Between malloc() and calloc() with examples]]></category>
		<category><![CDATA[difference between new malloc and calloc]]></category>
		<category><![CDATA[malloc and calloc full form]]></category>
		<category><![CDATA[malloc in c]]></category>
		<category><![CDATA[malloc() and calloc syntax]]></category>
		<category><![CDATA[malloc() vs calloc()]]></category>
		<category><![CDATA[what is calloc]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4982</guid>

					<description><![CDATA[calloc malloc We need to split and pass the memory we want We can pass how much memory we want. Ex: p=calloc(5,sizeof(int) Ex: p=malloc(5,sizeof(int) Function return void Functions Return void Returns starting address but before allocating to us it will zero it. It will clear the previous garbage value. Returns starting address. Calloc is slower [&#8230;]]]></description>
										<content:encoded><![CDATA[<table>
<tbody>
<tr>
<td width="235">
<h2 id="calloc" style="text-align: center;">calloc</h2>
</td>
<td width="243">
<h2 id="malloc" style="text-align: center;">malloc</h2>
</td>
</tr>
<tr>
<td width="235">We need to split and pass the memory we want</td>
<td width="243">We can pass how much memory we want.</td>
</tr>
<tr>
<td width="235"><strong>Ex:</strong> p=calloc(5,sizeof(int)</td>
<td width="243"><strong>Ex:</strong> p=malloc(5,sizeof(int)</td>
</tr>
<tr>
<td width="235">Function return void</td>
<td width="243">Functions Return void</td>
</tr>
<tr>
<td width="235">Returns starting address but before allocating to us it will zero it. It will clear the previous garbage value.</td>
<td width="243">Returns starting address.</td>
</tr>
<tr>
<td width="235">Calloc is slower than malloc</td>
<td width="243">Faster than calloc.</td>
</tr>
<tr>
<td width="235">It is safe as compared to malloc</td>
<td width="243">Not safe as calloc.</td>
</tr>
<tr>
<td width="235">Dynamic memory allocation</td>
<td width="243">A function which allocates block memory during run time.</p>
<p>&nbsp;</td>
</tr>
<tr>
<td width="235">There are 4 library routines calloc(), free(), alloc(),and malloc() which is used to allocate memory and free it up during the program execution</td>
<td width="243">Once when a memory space of specific size is allocated, it returns null pointer pointing to that allocated memory location.</p>
<p>&nbsp;</td>
</tr>
<tr>
<td width="235">Calloc() initialized the allocated memory to zero</td>
<td width="243">Malloc() doesn’t initializes the allocated memory. It contains garbage Values</td>
</tr>
<tr>
<td width="235">It allocates multiple block of requested memory.</td>
<td width="243">It allocates only single block of requested memory.</td>
</tr>
</tbody>
</table>
<h2 id="why-use-malloc">Why use malloc()</h2>
<ul>
<li>You can use malloc when you have to allocate objects which must exist beyond the execution of the memory block.</li>
<li>Malloc can be used if we need to allocate memory greater than size of stack.</li>
<li>Returns the pointer to the first byte of allocated space.</li>
<li>Enables developers to allocate memory as it is needed in the exact amount.</li>
<li>This function allocates memory block size bytes from the heap.</li>
</ul>
<h3 id="syntax-of-malloc"><strong>Syntax of malloc()</strong></h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">ptr = (cast_type *) malloc (byte_size); </code></pre> </div>
<ul>
<li>In above syntax, ptr is a pointer of cast_type. Malloc function returns the pointer to the allocated memory of byte _size.</li>
</ul>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-4983 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/malloc-calloc-in-c.jpg" alt="" width="398" height="160" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/malloc-calloc-in-c.jpg 398w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/malloc-calloc-in-c-300x121.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/malloc-calloc-in-c-390x157.jpg 390w" sizes="(max-width: 398px) 100vw, 398px" /></p>
<h2 id="example-of-malloc-in-c">Example of malloc() in C</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">ptr = (int * ) malloc(50)</code></pre> </div>
<ul>
<li>When this statement is executed, malloc reserves a memory space of 50 bytes. The address of the first byte reserved space is assigned to the pointer</li>
</ul>
<h2 id="why-use-calloc">Why use calloc()</h2>
<ul>
<li>When you have to set the allocated memory to 0.</li>
<li>You can use calloc() that returns a pointer to get access to memory heap.</li>
<li>Used when you need to initialize the elements to 0 to return a pointer to the memory.</li>
<li>To prevent overflow that is possible with malloc()</li>
<li>Use calloc() to request a page that is known to already be 0.</li>
</ul>
<h3 id="syntax-of-calloc">Syntax of Calloc()</h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">ptr = (cast_type *) calloc (n, size); </code></pre> </div>
<ul>
<li>The above syntax is used to allocate n memory blocks of the same size. After the memory space is allocated, all the bytes are initialized to zero. The pointer, which is currently at the first byte of the allocated memory space, is returned.</li>
</ul>
<h2 id=""></h2>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/difference-between-malloc-and-calloc/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is constant and variable in C ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-is-constant-and-variable-in-c/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-is-constant-and-variable-in-c/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Fri, 07 Oct 2022 09:03:07 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[c contstants]]></category>
		<category><![CDATA[c variables]]></category>
		<category><![CDATA[constants and literals]]></category>
		<category><![CDATA[constants and variables]]></category>
		<category><![CDATA[constants and variables in c]]></category>
		<category><![CDATA[constants vs variables in c language]]></category>
		<category><![CDATA[declare variable as constant in c]]></category>
		<category><![CDATA[difference between constant and variable in c]]></category>
		<category><![CDATA[difference between variables and constants in c]]></category>
		<category><![CDATA[non constant variable in c]]></category>
		<category><![CDATA[variable and constant in c]]></category>
		<category><![CDATA[variables and constants in c programming]]></category>
		<category><![CDATA[what is constant in c]]></category>
		<category><![CDATA[what is variable in c]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4977</guid>

					<description><![CDATA[Constant A constant is a value or identifier whose value is fixed and does not change, in the entire program. Constant is similar to a variable but it can hold only a single variable during the execution of program. Ex: const double PI = 3.14; Here, Const is a identifier Double is a data type [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2 id=""><img decoding="async" class="alignnone size-full wp-image-4978 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-constants-variable.jpg" alt="" width="933" height="363" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-constants-variable.jpg 933w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-constants-variable-300x117.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-constants-variable-768x299.jpg 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-constants-variable-390x152.jpg 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-constants-variable-820x319.jpg 820w" sizes="(max-width: 933px) 100vw, 933px" /></h2>
<h2 id="constant"><strong>Constant</strong></h2>
<ul>
<li>A constant is a value or identifier whose value is fixed and does not change, in the entire program.</li>
<li>Constant is similar to a variable but it can hold only a single variable during the execution of program.</li>
<li><strong>Ex: </strong><strong>const double PI = 3.14;</strong><br />
Here,</p>
<ul>
<li>Const is a identifier</li>
<li>Double is a data type</li>
<li>PI is a constant variable name that takes a value of 3.14.</li>
<li>This value of 3.14 does not change during the entire program.</li>
</ul>
</li>
</ul>
<h2 id="variable"><strong>Variable</strong></h2>
<ul>
<li>Variable is any characteristic, number, or quantity that can be measured or counted.</li>
<li>It is also called as data item.</li>
<li>A Variable is a name or an identifier that can store any values, and those values can be changed at any time during the program.</li>
<li>For example: <strong>int score = 6;</strong>
<ul>
<li>Here, score is a variable name of integer type that stores the value 6. The value of score can be changed any time during the program.</li>
</ul>
</li>
</ul>
<p><img decoding="async" class="alignnone size-full wp-image-4980 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/constant-vs-variable-in-c-1.jpg" alt="" width="580" height="320" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/constant-vs-variable-in-c-1.jpg 580w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/constant-vs-variable-in-c-1-300x166.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/constant-vs-variable-in-c-1-390x215.jpg 390w" sizes="(max-width: 580px) 100vw, 580px" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-is-constant-and-variable-in-c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is Dynamic data structure ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-is-dynamic-data-structure/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-is-dynamic-data-structure/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Fri, 07 Oct 2022 07:52:10 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[dynamic data structure]]></category>
		<category><![CDATA[dynamic data structures]]></category>
		<category><![CDATA[example of dynamic data structure]]></category>
		<category><![CDATA[is array a dynamic data structure]]></category>
		<category><![CDATA[is heap a dynamic data structure]]></category>
		<category><![CDATA[learn about dynamic data structure]]></category>
		<category><![CDATA[static data structure example]]></category>
		<category><![CDATA[static data structure vs dynamic data structure]]></category>
		<category><![CDATA[types of dynamic data structure]]></category>
		<category><![CDATA[what are static and dynamic data structures]]></category>
		<category><![CDATA[what is dynamic data structure]]></category>
		<category><![CDATA[what is dynamic data structure in c]]></category>
		<category><![CDATA[what is static data structure]]></category>
		<category><![CDATA[why linked list is called a dynamic data structure]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4974</guid>

					<description><![CDATA[We need a dynamic data structure to data efficiently into memory. Memory spaces in a program can be accessed using dynamic memory allocation. This is opposite to static data structure where the programmer has to fix the number of memory spaces manually. The structure that changes its size during run time is called a Dynamic [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li>We need a dynamic data structure to data efficiently into memory.</li>
<li>Memory spaces in a program can be accessed using dynamic memory allocation.</li>
<li>This is opposite to static data structure where the programmer has to fix the number of memory spaces manually.</li>
<li>The structure that changes its size during run time is called a Dynamic Data Structure.</li>
<li>Values stored in the data structure whether it is static or dynamic can be changed.</li>
<li>Both the data present in the data structure and the size of the data structure can be easily changed in the dynamic data structure.</li>
<li>Data that gets generated at the run time can be easily stored in dynamic data structure.</li>
<li>The size of the Data Structure can be easily increased during the run time of program execution.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4975" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-dynamic-data-structure.jpg" alt="" width="848" height="259" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-dynamic-data-structure.jpg 848w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-dynamic-data-structure-300x92.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-dynamic-data-structure-768x235.jpg 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-dynamic-data-structure-390x119.jpg 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-dynamic-data-structure-820x250.jpg 820w" sizes="(max-width: 848px) 100vw, 848px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-is-dynamic-data-structure/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What are the types of data types in C ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-are-the-types-of-data-types-in-c/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-are-the-types-of-data-types-in-c/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Fri, 07 Oct 2022 07:39:42 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[c data types]]></category>
		<category><![CDATA[data type in c]]></category>
		<category><![CDATA[data types in c]]></category>
		<category><![CDATA[data types in c and its types]]></category>
		<category><![CDATA[data types in c with examples]]></category>
		<category><![CDATA[double data type in c]]></category>
		<category><![CDATA[integer data type in c]]></category>
		<category><![CDATA[learn data types in c programming with examples]]></category>
		<category><![CDATA[size of data types in c]]></category>
		<category><![CDATA[understanding c datatypes]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4971</guid>

					<description><![CDATA[C language supports 3 data types: Primary Data Types User Defined Data Types Secondary Data Types Primary Data Types: Integer Float Char Double User Defined Data Types: Structure Union Enum Secondary Data Types: Array pointers]]></description>
										<content:encoded><![CDATA[<p style="text-align: justify;">C language supports 3 data types:</p>
<ul style="text-align: justify;">
<li>Primary Data Types</li>
<li>User Defined Data Types</li>
<li>Secondary Data Types</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4972 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-data-types-2.jpg" alt="" width="526" height="439" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-data-types-2.jpg 526w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-data-types-2-300x250.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-data-types-2-390x325.jpg 390w" sizes="(max-width: 526px) 100vw, 526px" /></p>
<p style="text-align: justify;"><strong>Primary Data Types:</strong></p>
<ul style="text-align: justify;">
<li>Integer</li>
<li>Float</li>
<li>Char</li>
<li>Double</li>
</ul>
<p style="text-align: justify;"><strong>User Defined Data Types:</strong></p>
<ul style="text-align: justify;">
<li>Structure</li>
<li>Union</li>
<li>Enum</li>
</ul>
<p style="text-align: justify;"><strong>Secondary Data Types:</strong></p>
<ul style="text-align: justify;">
<li>Array</li>
<li>pointers</li>
</ul>
<p style="text-align: justify;">
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-are-the-types-of-data-types-in-c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What do you mean by Data Type in C ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-do-you-mean-by-data-type-in-c/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-do-you-mean-by-data-type-in-c/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Fri, 07 Oct 2022 07:28:02 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[c data types]]></category>
		<category><![CDATA[data types in c]]></category>
		<category><![CDATA[data types in c programming language]]></category>
		<category><![CDATA[data types in c with examples]]></category>
		<category><![CDATA[float data type in c]]></category>
		<category><![CDATA[how many data types in c]]></category>
		<category><![CDATA[integer data types in c]]></category>
		<category><![CDATA[learn data types in c]]></category>
		<category><![CDATA[size of data types in c]]></category>
		<category><![CDATA[what is data type]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4966</guid>

					<description><![CDATA[Data type is type of the value that a variable can store. Each variable has its own data type and each data type occcupies different size of memory storage. Some commonly used data types are: char : char is a data type which stores single character. It needs one byte memory. Ex: char ch; Here [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">Data type is type of the value that a variable can store.</li>
<li style="text-align: justify;">Each variable has its own data type and each data type occcupies different size of memory storage.</li>
</ul>
<p style="text-align: justify;"><strong>Some commonly used data types are:</strong></p>
<ul style="text-align: justify;">
<li><strong>char :</strong> char is a data type which stores single character. It needs one byte memory.</li>
<li><strong>Ex: </strong><strong>char ch;</strong>
<ul>
<li>Here char is a data type that stores single character as its value.</li>
<li>Ch is variable name which stores the value of single character</li>
</ul>
</li>
</ul>
<ul style="text-align: justify;">
<li><strong>Int :</strong> integer is a data type that is used to store numerical numbers. It requires four-byte memory.</li>
<li><strong>Ex:</strong><strong>int i;</strong>
<ul>
<li>Here int is a data type that stores numbers.</li>
<li>i is variable of type integers.</li>
</ul>
</li>
</ul>
<ul style="text-align: justify;">
<li><strong>Float:</strong> is a data type that is used to store decimal numbers with one decimal point. It also requires 4 byte of memory.</li>
<li><strong>Ex:</strong><strong>float f;</strong>
<ul>
<li>Here float is a data type that stores decimal numbers with one decimal point. F is variable name.</li>
</ul>
</li>
</ul>
<ul style="text-align: justify;">
<li><strong>double:</strong> is a data type that is used to store decimal numbers with two decimal point.</li>
<li><strong>Ex:</strong><strong>double d;</strong>
<ul>
<li>Here  double is a data type to store decimal value with two points.</li>
<li>d is a variable name.</li>
</ul>
</li>
</ul>
<p style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4968 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/definition-of-data-types.jpg" alt="" width="656" height="229" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/definition-of-data-types.jpg 656w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/definition-of-data-types-300x105.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/definition-of-data-types-390x136.jpg 390w" sizes="(max-width: 656px) 100vw, 656px" /></p>
<p style="text-align: justify;"><strong> </strong></p>
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-do-you-mean-by-data-type-in-c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Difference between getc(), getchar(), getch() and getche()</title>
		<link>https://www.wikitechy.com/interview-questions/c/difference-between-getc-getchar-getch-and-getche/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/difference-between-getc-getchar-getch-and-getche/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Fri, 07 Oct 2022 07:04:39 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[difference between getc and fgetc]]></category>
		<category><![CDATA[difference between getc and getchar]]></category>
		<category><![CDATA[difference between getc()]]></category>
		<category><![CDATA[difference between getch and getche]]></category>
		<category><![CDATA[explain getch() getchar() gets() puts()]]></category>
		<category><![CDATA[getch() and getche()]]></category>
		<category><![CDATA[getchar in c]]></category>
		<category><![CDATA[getchar()]]></category>
		<category><![CDATA[getche header file]]></category>
		<category><![CDATA[getche in c]]></category>
		<category><![CDATA[getche() function in c]]></category>
		<category><![CDATA[what is the difference between getch() and getchar()]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4963</guid>

					<description><![CDATA[getc() This function gets single character as input and returns an integer value. If this fails, it returns EOF. Syntax of getc() getchar() The function getchar() reads the character from the standard input while getc() reads from the input stream.  Syntax of getchar()  getch() The function getch() is a non-standard function. It is included in [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2 id=""><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4964 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-getc-getch-getche.jpg" alt="" width="891" height="505" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-getc-getch-getche.jpg 891w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-getc-getch-getche-300x170.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-getc-getch-getche-768x435.jpg 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-getc-getch-getche-390x221.jpg 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-getc-getch-getche-820x465.jpg 820w" sizes="(max-width: 891px) 100vw, 891px" /></h2>
<h2 id="getc"><strong>getc()</strong></h2>
<ul>
<li>This function gets single character as input and returns an integer value. If this fails, it returns EOF.</li>
</ul>
<h3 id="syntax-of-getc"><strong>Syntax of getc()</strong></h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">int getc(FILE *stream);</code></pre> </div>
<h2 id="getchar"><strong>getchar()</strong></h2>
<ul>
<li>The function getchar() reads the character from the standard input while getc() reads from the input stream.</li>
</ul>
<h3 id="syntax-of-getchar"> <strong>Syntax of getchar() </strong></h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">  int getchar(void);</code></pre> </div>
<h2 id="getch"><strong>getch()</strong></h2>
<ul>
<li>The function getch() is a non-standard function.</li>
<li>It is included in “conio.h” header file.</li>
<li>Getch() is not a part of standard library.</li>
<li>It returns the entered character without even waiting for the enter key.</li>
</ul>
<h3 id="syntax-of-getch"> <strong> Syntax of getch()</strong></h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">int getch();</code></pre> </div>
<h2 id="getche"><strong>getche()</strong></h2>
<ul>
<li>Like getch(), the getche() function is also a non-standard function and is included in “conio.h” header file.</li>
<li>It reads a single character from the keyboard and returns it immediately without even waiting for enter key.</li>
</ul>
<h3 id="syntax-of-getche"> <strong>Syntax of getche()</strong></h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">int getche(void);</code></pre> </div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/difference-between-getc-getchar-getch-and-getche/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is the difference between puts() and printf() ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-is-the-difference-between-puts-and-printf/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-is-the-difference-between-puts-and-printf/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Fri, 07 Oct 2022 06:46:38 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[difference between gets and scanf]]></category>
		<category><![CDATA[difference between printf and puts]]></category>
		<category><![CDATA[difference between printf and puts in c]]></category>
		<category><![CDATA[difference between puts and print]]></category>
		<category><![CDATA[puts() function in c]]></category>
		<category><![CDATA[puts() vs printf()]]></category>
		<category><![CDATA[puts() vs printf() for printing a string]]></category>
		<category><![CDATA[puts() vs printf() for printing a string in c]]></category>
		<category><![CDATA[what is the difference between printf and puts in c]]></category>
		<category><![CDATA[What is the difference between puts() and printf() ?]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4960</guid>

					<description><![CDATA[Printf() Puts() Declared in the header file stdio.h Declared in the header file stdio.h Function to print a formatted string to the standard output stream which is the computer screen. This function prints string on the output stream with a new line character. Syntax for printf is printf(str) Syntax for puts() is : puts(str) Does [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4961" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/puts-printf.jpg" alt="" width="933" height="426" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/puts-printf.jpg 933w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/puts-printf-300x137.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/puts-printf-768x351.jpg 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/puts-printf-390x178.jpg 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/puts-printf-820x374.jpg 820w" sizes="(max-width: 933px) 100vw, 933px" /></p>
<table>
<tbody>
<tr>
<td width="177">
<p style="text-align: center;"><strong>Printf()</strong></p>
</td>
<td width="177">
<p style="text-align: center;"><strong>Puts()</strong></p>
</td>
</tr>
<tr>
<td width="177">Declared in the header file stdio.h</td>
<td width="177">Declared in the header file stdio.h</td>
</tr>
<tr>
<td width="177">Function to print a formatted string to the standard output stream which is the computer screen.</td>
<td width="177">This function prints string on the output stream with a new line character.</td>
</tr>
<tr>
<td width="177">Syntax for printf is printf(str)</td>
<td width="177">Syntax for puts() is : puts(str)</td>
</tr>
<tr>
<td width="177">Does not move the cursor to the next line.</td>
<td width="177">Moves the cursor to the next line.</td>
</tr>
<tr>
<td width="177">Implementation of printf is complicated.</td>
<td width="177">Implementation of puts() is very simpler than printf()</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-is-the-difference-between-puts-and-printf/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is l-value and r-value in C ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-is-l-value-and-r-value-in-c/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-is-l-value-and-r-value-in-c/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Fri, 07 Oct 2022 06:12:45 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[l-value and r-value expressions]]></category>
		<category><![CDATA[lvalue and rvalue]]></category>
		<category><![CDATA[lvalue and rvalue in c]]></category>
		<category><![CDATA[lvalue and rvalue in c language]]></category>
		<category><![CDATA[lvalue and rvalue in c with example]]></category>
		<category><![CDATA[lvaules and rvalues]]></category>
		<category><![CDATA[understanding lvalues and rvalues inc]]></category>
		<category><![CDATA[what are lvalue and rvalue in c]]></category>
		<category><![CDATA[what is an lvalue in c]]></category>
		<category><![CDATA[what is lvalue]]></category>
		<category><![CDATA[what is lvalue in c]]></category>
		<category><![CDATA[what is rvalue in c]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4957</guid>

					<description><![CDATA[L Value L value or locator value represents an object that occupies some identifiable location in memory. In an assignment operator the l value can appear on right hand side or left hand side. Expression which refer to modifiable locations are called as “Modifiable L Values”. An incomplete type or constant attribute cannot have an [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2 id="l-value" style="text-align: justify;">L Value</h2>
<ul style="text-align: justify;">
<li>L value or locator value represents an object that occupies some identifiable location in memory.</li>
<li>In an assignment operator the l value can appear on right hand side or left hand side.</li>
<li>Expression which refer to modifiable locations are called as “Modifiable L Values”.</li>
<li>An incomplete type or constant attribute cannot have an array type of modifiable value attribute.</li>
<li>Structures and Unions to be a modified lvalues, they should not contain any members with constant attribute.</li>
<li>Storage location will be denoted by an identifier with name,value stored at a location will have the value of the variable.</li>
<li>A lvalue identifier can be modified it refers to a memory location and if the type of it is arithmetic, structure, union or pointer.</li>
<li>Example: If a pointer points to a storage region, then *ptr is a modifiable l value that allocates the storage region to which *ptr points.</li>
<li>In C, this concept was termed “Locator Value”. And referred to expressions that locate objects.</li>
</ul>
<p style="text-align: justify;"><strong>The l-value is one of the following</strong></p>
<ul style="text-align: justify;">
<li>The name of the variable of any type i.e, an identifier of integral, floating, pointer, structure, or union type.</li>
<li>A subscript ([ ]) expression that does not evaluate to an array.</li>
<li>A unary-indirection (*) expression that does not refer to an array</li>
<li>An l-value expression in parentheses.</li>
<li>A constobject (a nonmodifiable l-value).</li>
<li>The result of indirection through a pointer, provided that it isn’t a function pointer.</li>
<li>The result of member access through pointer(-&gt; or .)</li>
</ul>
<h2 id="r-value" style="text-align: justify;">R Value</h2>
<ul style="text-align: justify;">
<li>R- value refer to data value that is stored at some address in memory.</li>
<li>R value is an expression that does not have a value assigned to it which means r value can either right side or left side of an assignment operator.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4958 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-lvalue-and-rvalue.jpg" alt="" width="387" height="243" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-lvalue-and-rvalue.jpg 387w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-lvalue-and-rvalue-300x188.jpg 300w" sizes="(max-width: 387px) 100vw, 387px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-is-l-value-and-r-value-in-c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is a header file in C ? What will happen if we include a header file twice in a C program ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Fri, 07 Oct 2022 06:03:47 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[c including header files multiple times]]></category>
		<category><![CDATA[Header Files in C]]></category>
		<category><![CDATA[Header files in C/C++ and its uses]]></category>
		<category><![CDATA[Header files in C/C++ with Examples]]></category>
		<category><![CDATA[if we include the same header file twice]]></category>
		<category><![CDATA[In C language]]></category>
		<category><![CDATA[including a header file twice in c]]></category>
		<category><![CDATA[list of header files in c its function]]></category>
		<category><![CDATA[use of header file in c]]></category>
		<category><![CDATA[what are header files in c]]></category>
		<category><![CDATA[What happens if we include header file for two times in a C]]></category>
		<category><![CDATA[what is header file in c]]></category>
		<category><![CDATA[What will happen if we include a header file twice]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4954</guid>

					<description><![CDATA[Header files store the definitions and rules for different built-in functions in the C program. For example, printf(), scanf() functions are defined in stdio.h header file. A header file is a file with extention .h which contains C function declarations and macro definitions to be shared between several source files. There are two types of [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li>Header files store the definitions and rules for different built-in functions in the C program.</li>
<li>For example, printf(), scanf() functions are defined in stdio.h header file.</li>
<li>A header file is a file with extention .h which contains C function declarations and macro definitions to be shared between several source files.</li>
<li>There are two types of header file-files that a programmer writes and a file that comes with your compiler.</li>
<li>Every header file contains a set of predefined functions, which makes c programming simpler.</li>
<li>We should include the header file at the start of the program to be able to use the functions defined in the program.</li>
<li>When header files are added twice in a program, the compiler will process its contents twice.</li>
<li>This may cause an error when the compiler sees the same structure definition twice<strong>.</strong></li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4955" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-header-file-in-c.jpg" alt="" width="845" height="469" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-header-file-in-c.jpg 845w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-header-file-in-c-300x167.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-header-file-in-c-768x426.jpg 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-header-file-in-c-390x216.jpg 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-header-file-in-c-820x455.jpg 820w" sizes="(max-width: 845px) 100vw, 845px" /></p>
<p><strong> </strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-is-a-header-file-in-c-what-will-happen-if-we-include-a-header-file-twice-in-a-c-program/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Explain break and continue statements with examples</title>
		<link>https://www.wikitechy.com/interview-questions/c/explain-break-and-continue-statements-with-examples/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/explain-break-and-continue-statements-with-examples/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Fri, 07 Oct 2022 05:35:57 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[break and continue in c programming]]></category>
		<category><![CDATA[break and continue statement in c]]></category>
		<category><![CDATA[break statement in c example]]></category>
		<category><![CDATA[break vs continue in c]]></category>
		<category><![CDATA[c break and continue]]></category>
		<category><![CDATA[c break and continue with examples]]></category>
		<category><![CDATA[c programming break and continue statements]]></category>
		<category><![CDATA[continue statement in c example]]></category>
		<category><![CDATA[difference between break and continue statement in c]]></category>
		<category><![CDATA[difference between break and continue statements in c]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4947</guid>

					<description><![CDATA[Break This statement is used with switch statement. Can also be used with while loop, do – while loop and for loop. When the control encounters a break statement, the control will terminate the loop immediately and the statements after break will not be executed. Syntax Sample Code Output Continue This statement is used to [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2 id="break" style="text-align: justify;"><strong>Break</strong></h2>
<ul style="text-align: justify;">
<li>This statement is used with switch statement.</li>
<li>Can also be used with while loop, do – while loop and for loop.</li>
<li>When the control encounters a break statement, the control will terminate the loop immediately and the statements after break will not be executed.</li>
</ul>
<h3 id="syntax" style="text-align: justify;">Syntax</h3>
<p style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4948 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-break-statement.jpg" alt="" width="529" height="346" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-break-statement.jpg 529w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-break-statement-300x196.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-break-statement-390x255.jpg 390w" sizes="(max-width: 529px) 100vw, 529px" /></p>
<h3 id="sample-code" style="text-align: justify;">Sample Code</h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">#include&lt;stdio.h&gt;<br/>int main()<br/>{<br/>  <br/>    int i = 0 , j = 0;<br/>  <br/>    // Iterate a loop over the<br/>    // range [0, 5]<br/>     for(int i = 0 ; i &lt; 5 ; i ++)<br/>    {<br/>          printf(“i = %d, j = “, i);<br/>  <br/>        // Iterate a loop over the<br/>        // range [0, 5]<br/>        for(int j = 0 ; j &lt; 5 ; J ++){<br/>  <br/>            // Usage of Break statement<br/>             If ( j == 2)<br/>            <br/>                break;<br/>             printf(“%d “, j);<br/>                    }<br/>  <br/>        printf(&quot;\n&quot;);<br/>    }<br/>  <br/>    return 0;<br/>}</code></pre> </div>
<h3 id="output" style="text-align: justify;">Output</h3>
<p style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4949 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/break-statement-in-c.jpg" alt="" width="146" height="164" /></p>
<h2 id="continue" style="text-align: justify;"><strong>Continue</strong></h2>
<ul style="text-align: justify;">
<li>This statement is used to bring the control to the beginning of the loop.</li>
<li>The continue statement skips some lines of code inside the loop and continues with the next iteration.</li>
<li>It is mainly used in a program for skiiping certain condition.</li>
<li>This statement does not exit from the loop of the body.</li>
<li>It is not used to exit from the loop body.</li>
<li>Continue statement is not used with switch statement.</li>
<li>It can be used only with while, do while and for loop.</li>
<li>When the control encounters continue statement,control automatically executes the remaining statements of the loop body.</li>
</ul>
<h3 id="syntax-2" style="text-align: justify;">Syntax</h3>
<p style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4950 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-break-and-continue.jpg" alt="" width="559" height="325" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-break-and-continue.jpg 559w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-break-and-continue-300x174.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-break-and-continue-390x227.jpg 390w" sizes="(max-width: 559px) 100vw, 559px" /></p>
<h3 id="sample-code-2" style="text-align: justify;">Sample Code</h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">#include &lt;stdio.h&gt;<br/>  <br/>// Driver Code<br/>int main()<br/>{<br/>      Int i = 0 , j = 0 ;<br/>  <br/>    // Iterate the loop over the range[0,5]<br/>    for (int i = 0; i &lt; 5; i++) {<br/>         printf(“i = %d, j = “, i);<br/>        // Iterate the loop over the range[0,5]<br/>        For(int j = 0; j &lt; 5 ; j++){  <br/>         // Usage of Continue Statement<br/>            if (j == 2)<br/>                continue;<br/>              printf(&quot;%d &quot;, j);<br/>        }<br/>            printf(“\n”);<br/>            }<br/>  <br/>    return 0;<br/>}</code></pre> </div>
<h3 id="output-2" style="text-align: justify;">Output</h3>
<p style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4951 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-continue-statement.jpg" alt="" width="192" height="160" /></p>
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/explain-break-and-continue-statements-with-examples/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is dangling Pointer in c ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-is-dangling-pointer-in-c/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-is-dangling-pointer-in-c/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Thu, 06 Oct 2022 10:38:33 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[dangline pointer]]></category>
		<category><![CDATA[dangling pointer]]></category>
		<category><![CDATA[dangling pointer c]]></category>
		<category><![CDATA[dangling pointer example]]></category>
		<category><![CDATA[dangling pointer in c example]]></category>
		<category><![CDATA[dangling pointer in c with example]]></category>
		<category><![CDATA[dangling pointer in c++]]></category>
		<category><![CDATA[dangling pointers and memory faults]]></category>
		<category><![CDATA[dangling pointers in c]]></category>
		<category><![CDATA[understanding the dangling pointers]]></category>
		<category><![CDATA[what is a dangling pointer]]></category>
		<category><![CDATA[what is dangling pointer and how to avoid it]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4944</guid>

					<description><![CDATA[The most common bugs related to pointer &#38; memory management is called dangling or wild pointers. Sometimes programmer fails to assign the pointer with a valid address, then this type of assigned or initialized pointer is known as dangling pointer. Dangling pointer usually occurs during object destruction when the object is deleted or deallocated from [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">The most common bugs related to pointer &amp; memory management is called dangling or wild pointers.</li>
<li>Sometimes programmer fails to assign the pointer with a valid address, then this type of assigned or initialized pointer is known as dangling pointer.</li>
<li>Dangling pointer usually occurs during object destruction when the object is deleted or deallocated from memory without changing the values or address of the pointer.</li>
<li>Dangling pointer points to the memory which contains either the program code or code of the operating system.</li>
<li>If a value or address is assigned to this type of pointer, it overwrites the program&#8217;s value or operating system instructions.</li>
<li>During this time, the program may show the undesirable results or may crash.</li>
<li>If the memory is re allocated to some other process, then we will dereference the dangling pointer.</li>
<li style="text-align: justify;">This dereferencing of the dangling pointer may cause segmentation faults.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4945 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-do-you-mean-by-dangling-pointer.jpg" alt="" width="388" height="285" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-do-you-mean-by-dangling-pointer.jpg 388w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-do-you-mean-by-dangling-pointer-300x220.jpg 300w" sizes="(max-width: 388px) 100vw, 388px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-is-dangling-pointer-in-c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What are called and calling functions ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-are-called-and-calling-functions/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-are-called-and-calling-functions/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Thu, 06 Oct 2022 10:21:12 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[c functions]]></category>
		<category><![CDATA[c user-defined functions]]></category>
		<category><![CDATA[called function and calling function]]></category>
		<category><![CDATA[calling a functio in c programming]]></category>
		<category><![CDATA[function in c programming examples]]></category>
		<category><![CDATA[types of function calls in c]]></category>
		<category><![CDATA[types of functions in c]]></category>
		<category><![CDATA[what is a called function and calling function in c]]></category>
		<category><![CDATA[what is called function]]></category>
		<category><![CDATA[what is called function and calling function in c]]></category>
		<category><![CDATA[what is calling function in c]]></category>
		<category><![CDATA[what is function call in c]]></category>
		<category><![CDATA[what is function in c]]></category>
		<category><![CDATA[what is the function call in c]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4938</guid>

					<description><![CDATA[A function call is very important in programming. When we need to call a function, it is called inside a program. A function which is being called by the parent functions is known as called functions Function which is being called is known as calling function. A function is called by the program whenever it [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">A function call is very important in programming.</li>
<li style="text-align: justify;">When we need to call a function, it is called inside a program.</li>
<li style="text-align: justify;">A function which is being called by the parent functions is known as called functions</li>
<li style="text-align: justify;">Function which is being called is known as calling function.</li>
<li style="text-align: justify;">A function is called by the program whenever it is needed.</li>
<li style="text-align: justify;">Functions are called by its name in the main program.</li>
<li style="text-align: justify;">We can pass parameters to the functions that are being called in the main function.</li>
</ul>
<p style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4942 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-are-called-and-calling-function.jpg" alt="" width="796" height="402" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-are-called-and-calling-function.jpg 796w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-are-called-and-calling-function-300x152.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-are-called-and-calling-function-768x388.jpg 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-are-called-and-calling-function-390x197.jpg 390w" sizes="(max-width: 796px) 100vw, 796px" /></p>
<h2 id="syntax" style="text-align: justify;"><strong>Syntax</strong></h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">Add(a, b) // a and b are the parameters </code></pre> </div>
<h3 id="calling-a-function-in-c-program" style="text-align: justify;">Calling a function in C program</h3>
<h3 id="add-c" style="text-align: justify;"><strong>Add.c</strong></h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">#include &lt;stdio.h&gt;  <br/>int add(int a, int b);   <br/>void main()  <br/>{  <br/>  <br/>int sum;  <br/>int a, b;  <br/>printf(&quot; Enter the first and second number \n&quot;);  <br/>scanf(&quot;%d %d&quot;, &amp;a, &amp;b);  <br/>sum = add(a, b); // call add() function  <br/>printf( &quot;The sum of the two number is %d&quot;, sum);  <br/>}  <br/>int add(int n1, int n2) // pass n1 and n2 parameter  <br/>{  <br/>int c;  <br/>c = n1 + n2;  <br/>return c;  <br/>}  </code></pre> </div>
<h3 id="output" style="text-align: justify;">Output</h3>
<p style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4939 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/calling-function-c.jpg" alt="" width="299" height="141" /></p>
<h2 id="call-by-value" style="text-align: justify;"><strong>Call by value</strong></h2>
<ul style="text-align: justify;">
<li>When an single or multiple values of an argument are copied into formal parameters of a function, this type of functions is known as Call By Value.</li>
<li>It does not change the value of the function`s actual parameter.</li>
</ul>
<h3 id="call-by-value-in-c-programming" style="text-align: justify;">Call by Value in C programming</h3>
<h3 id="call_value-c" style="text-align: justify;"><strong>Call_Value.c</strong></h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">#include &lt;stdio.h&gt;  <br/>int main()  <br/>{  <br/>int x = 10, y = 20;  <br/>printf (&quot; x = %d, y = %d from main before calling the function&quot;, x, y);  <br/>CallValue(x, y);  <br/>printf( &quot;\n x = %d, y = %d from main after calling the function&quot;, x, y);  <br/>}  <br/>int CallValue( int x, int y)  <br/>{  <br/>x = x + 5;  <br/>y = y + 5;  <br/>printf (&quot; \nx = %d, y = %d from modular function&quot;, x, y);  <br/>}   </code></pre> </div>
<h3 id="output-2" style="text-align: justify;">Output</h3>
<p style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4940 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/call-by-value-in-c-programming.jpg" alt="" width="476" height="119" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/call-by-value-in-c-programming.jpg 476w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/call-by-value-in-c-programming-300x75.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/call-by-value-in-c-programming-390x98.jpg 390w" sizes="(max-width: 476px) 100vw, 476px" /></p>
<h2 id="call-by-reference" style="text-align: justify;"><strong>Call By Reference</strong></h2>
<ul style="text-align: justify;">
<li>As name suggests call by reference is a method, where the address of the actual argument is copied into the function call&#8217;s formal parameter.</li>
<li>This type of method is known as Call by Reference.</li>
<li>If we make some changes in the formal parameters, it shows the effect in the value of the actual parameter.</li>
</ul>
<h3 id="call-by-reference-in-c-programming" style="text-align: justify;">Call by Reference in C programming</h3>
<h3 id="call_ref-c" style="text-align: justify;"><strong>Call_Ref.c</strong></h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">#include &lt;stdio.h&gt;  <br/>int main()  <br/>{  <br/>int x = 10, y = 20;  <br/>printf (&quot; x = %d, y = %d from main before calling the function&quot;, x, y);  <br/>CallValue (&amp;x, &amp;y);  <br/>printf( &quot;\n x = %d, y = %d from main after calling the function&quot;, x, y);  <br/>}  <br/>int CallRef( int *a, int *b)  <br/>{  <br/>*a = *a + 5;  <br/>*b = *b + 5;  <br/>printf (&quot; \nx = %d, y = %d from modular function&quot;, *a, *b);  <br/>}  </code></pre> </div>
<h3 id="output-3" style="text-align: justify;">Output</h3>
<p style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4941 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/call-by-reference-in-c.jpg" alt="" width="474" height="116" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/call-by-reference-in-c.jpg 474w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/call-by-reference-in-c-300x73.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/call-by-reference-in-c-390x95.jpg 390w" sizes="(max-width: 474px) 100vw, 474px" /></p>
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-are-called-and-calling-functions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How many types of data type in C Language ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/how-many-types-of-data-type-in-c-language/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/how-many-types-of-data-type-in-c-language/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 03 Oct 2022 12:41:19 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[c data types]]></category>
		<category><![CDATA[data types in c]]></category>
		<category><![CDATA[data types in c and its types]]></category>
		<category><![CDATA[data types in c with examples]]></category>
		<category><![CDATA[double data type in c]]></category>
		<category><![CDATA[how many types of data type in c language]]></category>
		<category><![CDATA[integer data type in c]]></category>
		<category><![CDATA[learn data types in c programming with examples]]></category>
		<category><![CDATA[primitive data types in c]]></category>
		<category><![CDATA[size of data types in c]]></category>
		<category><![CDATA[what are data types in c]]></category>
		<category><![CDATA[what are the basic data types in c]]></category>
		<category><![CDATA[what is data type and its types]]></category>
		<category><![CDATA[what is data type and its types in c]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4934</guid>

					<description><![CDATA[C language supports 3 data types: Primary Data Types User Defined Data Types Secondary Data Types Primary Data Types Integer Float Char Double User Defined Data Types Structure Union Enum Secondary Data Types Array pointers]]></description>
										<content:encoded><![CDATA[<p style="text-align: justify;">C language supports 3 data types:</p>
<ul style="text-align: justify;">
<li>Primary Data Types</li>
<li>User Defined Data Types</li>
<li>Secondary Data Types</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4935 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-data-types.jpg" alt="" width="526" height="439" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-data-types.jpg 526w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-data-types-300x250.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/c-data-types-390x325.jpg 390w" sizes="(max-width: 526px) 100vw, 526px" /></p>
<h2 id="primary-data-types" style="text-align: justify;"><strong>Primary Data Types</strong></h2>
<ul style="text-align: justify;">
<li>Integer</li>
<li>Float</li>
<li>Char</li>
<li>Double</li>
</ul>
<h2 id="user-defined-data-types" style="text-align: justify;"><strong>User Defined Data Types</strong></h2>
<ul style="text-align: justify;">
<li>Structure</li>
<li>Union</li>
<li>Enum</li>
</ul>
<h2 id="secondary-data-types" style="text-align: justify;"><strong>Secondary Data Types</strong></h2>
<ul style="text-align: justify;">
<li>Array</li>
<li>pointers</li>
</ul>
<p style="text-align: justify;">
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/how-many-types-of-data-type-in-c-language/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is the use of printf() and scanf() functions ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-is-the-use-of-printf-and-scanf-functions/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-is-the-use-of-printf-and-scanf-functions/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 03 Oct 2022 12:05:56 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[c input/output]]></category>
		<category><![CDATA[c printf() and scanf() functions]]></category>
		<category><![CDATA[fprintf in c]]></category>
		<category><![CDATA[printf and scanf functions in c]]></category>
		<category><![CDATA[printf scanf in c]]></category>
		<category><![CDATA[printf() and scanf()]]></category>
		<category><![CDATA[return values of printf() and scanf() in c]]></category>
		<category><![CDATA[scanf and printf in c]]></category>
		<category><![CDATA[scanf string in c]]></category>
		<category><![CDATA[scanf syntax]]></category>
		<category><![CDATA[scanf() used for]]></category>
		<category><![CDATA[syntax of printf in c]]></category>
		<category><![CDATA[use of printf in c]]></category>
		<category><![CDATA[what is the use of printf() and scanf() functions]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4931</guid>

					<description><![CDATA[Scanf() Scanf() is the most commonly used in C langauage. They are inbuilt functions in the c program which is in the stdio.h(header file). It is an input function in the c program that takes input values from the user. It is a function that reads formatted data from stdin(standard input stream), which is keyboard, [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2 id=""><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4932 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-scanf-and-printf.jpg" alt="" width="875" height="435" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-scanf-and-printf.jpg 875w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-scanf-and-printf-300x149.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-scanf-and-printf-768x382.jpg 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-scanf-and-printf-390x194.jpg 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/difference-between-scanf-and-printf-820x408.jpg 820w" sizes="(max-width: 875px) 100vw, 875px" /></h2>
<h2 id="scanf" style="text-align: justify;"><strong>Scanf()</strong></h2>
<ul style="text-align: justify;">
<li>Scanf() is the most commonly used in C langauage.</li>
<li>They are inbuilt functions in the c program which is in the stdio.h(header file).</li>
<li>It is an input function in the c program that takes input values from the user.</li>
<li>It is a function that reads formatted data from stdin(standard input stream), which is keyboard, unless redirected, and then writes the results to arguments.</li>
</ul>
<h2 id="printf" style="text-align: justify;"><strong>Printf()</strong></h2>
<ul style="text-align: justify;">
<li>Printf() is used to display the output.</li>
<li>They are inbuilt functions in the c program which is in the stdio.h(header file).</li>
<li>It is a function that prints a string on the screen using a format string that contains mix of several strings.</li>
<li>It produces a final string to be printed on the screen.</li>
<li>It is an output function in the c program that prints output values to the console.</li>
</ul>
<p>&nbsp;</p>
<p style="text-align: justify;">
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-is-the-use-of-printf-and-scanf-functions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is While Loop in C Language with example ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-is-while-loop-in-c-language-with-example/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-is-while-loop-in-c-language-with-example/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 03 Oct 2022 11:52:50 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[c while and do..while loop]]></category>
		<category><![CDATA[c while loop]]></category>
		<category><![CDATA[do while loop example]]></category>
		<category><![CDATA[do-while loop in c programming examples]]></category>
		<category><![CDATA[for loop in c programming example]]></category>
		<category><![CDATA[for loop in c programming examples]]></category>
		<category><![CDATA[while loop example]]></category>
		<category><![CDATA[while loop in c]]></category>
		<category><![CDATA[while loop in c language with examples]]></category>
		<category><![CDATA[while loop in c programming example]]></category>
		<category><![CDATA[while loop in c programming with example]]></category>
		<category><![CDATA[while loop syntax]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4928</guid>

					<description><![CDATA[While loop evaluates the conditions inside the brackets. If the condition returns true, the statements inside the while loop body will be executed. Condition inside the while loop is executed once again. This process goes on until the condition in the while loop becomes false. Once the condition is false, while loop terminates. Syntax of [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li>While loop evaluates the conditions inside the brackets.</li>
<li>If the condition returns true, the statements inside the while loop body will be executed.</li>
<li>Condition inside the while loop is executed once again.</li>
<li>This process goes on until the condition in the while loop becomes false.</li>
<li>Once the condition is false, while loop terminates.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4929 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/while-loop-in-c.jpg" alt="" width="331" height="341" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/while-loop-in-c.jpg 331w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/while-loop-in-c-291x300.jpg 291w" sizes="(max-width: 331px) 100vw, 331px" /></p>
<h2 id="syntax-of-while-loop">Syntax of While loop</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">while (testExpression) {<br/>  // the body of the loop <br/>}</code></pre> </div>
<h2 id="sample-code">Sample Code</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">// Print numbers from 1 to 5<br/><br/>#include &lt;stdio.h&gt;<br/>int main() {<br/>  int i = 1;<br/>    <br/>  while (i &lt;= 5) {<br/>    printf(&quot;%d\n&quot;, i);<br/>    ++i;<br/>  }<br/><br/>  return 0;<br/>}</code></pre> </div>
<h2 id="output">Output</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">1<br/>2<br/>3<br/>4<br/>5</code></pre> </div>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-is-while-loop-in-c-language-with-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Explain IF-Else Statement in C Language ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/explain-if-else-statement-in-c-language/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/explain-if-else-statement-in-c-language/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 03 Oct 2022 10:08:04 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[c conditional statement]]></category>
		<category><![CDATA[c if else statement]]></category>
		<category><![CDATA[c if..else]]></category>
		<category><![CDATA[explain if-else statement with suitable example]]></category>
		<category><![CDATA[how to use if-else statements in the c]]></category>
		<category><![CDATA[if else program in c]]></category>
		<category><![CDATA[if else statement in c]]></category>
		<category><![CDATA[if statement example]]></category>
		<category><![CDATA[if statement in c example]]></category>
		<category><![CDATA[if-else statement in c programming]]></category>
		<category><![CDATA[if..else statement syntax]]></category>
		<category><![CDATA[nested if-else statement in c example]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4922</guid>

					<description><![CDATA[If statement in C is known as a decision-making statement. It makes a decision based on the condition given. It is followed by an optional else statement. The block of codes inside the if statement is executed only if the given condition is true. Codes inside the curly braces are skipped if the condition evaluates [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li>If statement in C is known as a decision-making statement.</li>
<li>It makes a decision based on the condition given.</li>
<li>It is followed by an optional else statement.</li>
<li>The block of codes inside the if statement is executed only if the given condition is true.</li>
<li>Codes inside the curly braces are skipped if the condition evaluates to false, and the code after the if statements are executed.</li>
<li>Code inside parenthesis of the if statement is true, everything within the curly braces is executed.</li>
<li>If condition true evaluates to true, code runs the printf execution.</li>
</ul>
<h2 id="syntax">Syntax</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">if (testCondition) {<br/>   // statements<br/>}</code></pre> </div>
<h2 id="sample-code">Sample Code</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">#include &lt;stdio.h&gt;<br/>#include &lt;stdbool.h&gt;<br/><br/>int main(void) {<br/>    if(true) {<br/>        printf(&quot;Statement is True!\n&quot;);<br/>    }<br/><br/>    return 0;<br/>}</code></pre> </div>
<h2 id="output">Output</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">Statement is True.</code></pre> </div>
<h3 id="if-else-statements">if..else statements</h3>
<ul>
<li>In an ..else statement, code inside the brackets is executed only if the statement condition evaluates to true.</li>
<li>If the condition in the if statement evaluates to false, the code inside the else statement is executed.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4926 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/if_else_statement.png" alt="" width="251" height="321" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/if_else_statement.png 251w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/if_else_statement-235x300.png 235w" sizes="(max-width: 251px) 100vw, 251px" /></p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/explain-if-else-statement-in-c-language/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is recursion in C ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-is-recursion-in-c/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-is-recursion-in-c/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 03 Oct 2022 07:55:03 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[advantages of recursion in c]]></category>
		<category><![CDATA[c function recursions]]></category>
		<category><![CDATA[c recursion]]></category>
		<category><![CDATA[how recursion works in c]]></category>
		<category><![CDATA[introduction to recursion]]></category>
		<category><![CDATA[recursion example]]></category>
		<category><![CDATA[recursion function in c programming]]></category>
		<category><![CDATA[recursion in c]]></category>
		<category><![CDATA[recursion in c programming]]></category>
		<category><![CDATA[recursion problems in c]]></category>
		<category><![CDATA[types of recursion in c]]></category>
		<category><![CDATA[what is recursion in c]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4918</guid>

					<description><![CDATA[Recursion is a process that happens when a function calls a copy of itself to work on any smaller problem. Any function that calls itself repeatedly is called a recursive function. Such calls are called recursive calls. Recursion involves several recursive calls. Recursion cannot be applied to all the problems, it is useful for the [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul style="text-align: justify;">
<li style="text-align: justify;">Recursion is a process that happens when a function calls a copy of itself to work on any smaller problem.</li>
<li>Any function that calls itself repeatedly is called a recursive function. Such calls are called recursive calls.</li>
<li>Recursion involves several recursive calls.</li>
<li>Recursion cannot be applied to all the problems, it is useful for the tasks that can be defined in terms of subtasks.</li>
<li>Problems that are best suited and that can be solved using Recursion are: Tower of Hanoi, Fibonacci Series, factorial finding, etc.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4919 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/recursion-in-c.jpg" alt="" width="865" height="450" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/recursion-in-c.jpg 865w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/recursion-in-c-300x156.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/recursion-in-c-768x400.jpg 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/recursion-in-c-390x203.jpg 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/recursion-in-c-820x427.jpg 820w" sizes="(max-width: 865px) 100vw, 865px" /></p>
<h2 id="how-does-recursion-work" style="text-align: justify;">How does Recursion work</h2>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4920 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/recursion-c.png" alt="" width="464" height="341" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/recursion-c.png 464w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/recursion-c-300x220.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/recursion-c-390x287.png 390w" sizes="(max-width: 464px) 100vw, 464px" /></p>
<p>&nbsp;</p>
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-is-recursion-in-c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is Switch Statement in C with example ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-is-switch-statement-in-c-with-example/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-is-switch-statement-in-c-with-example/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 03 Oct 2022 06:56:02 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[c switch statement]]></category>
		<category><![CDATA[example of switch statement]]></category>
		<category><![CDATA[switch case example in c]]></category>
		<category><![CDATA[switch case in c]]></category>
		<category><![CDATA[switch case in c programming examples]]></category>
		<category><![CDATA[switch case in c programming questions]]></category>
		<category><![CDATA[switch statement in c++]]></category>
		<category><![CDATA[switch statement with examples]]></category>
		<category><![CDATA[switch--case in c programming]]></category>
		<category><![CDATA[syntax of switch statement]]></category>
		<category><![CDATA[what is switch in c language]]></category>
		<category><![CDATA[what is switch in c programming]]></category>
		<category><![CDATA[what is switch statement in c]]></category>
		<category><![CDATA[what is switch statement in c programming]]></category>
		<category><![CDATA[what is switch statement in c with example]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4911</guid>

					<description><![CDATA[Switch statement is an alternative to if else ladder statement which allows us to execute multiple operations for different values. We can define various statement in multiple cases for different values of single variable. Rules for switch statement Switch expression should be an integer or character data type. Case value must be an integer or [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul style="text-align: justify;">
<li style="text-align: justify;">Switch statement is an alternative to if else ladder statement which allows us to execute multiple operations for different values.</li>
<li>We can define various statement in multiple cases for different values of single variable.</li>
</ul>
<h2 id="rules-for-switch-statement" style="text-align: justify;">Rules for switch statement</h2>
<ul style="text-align: justify;">
<li>Switch expression should be an integer or character data type.</li>
<li>Case value must be an integer or constant value.</li>
<li>We can use only case value inside the switch statement.</li>
<li>Break statement is not mandatory in switch. It is optional.</li>
<li>If a program does not find a break statement in switch expression, all the cases in the switch will be executed along with the matched case.</li>
</ul>
<h2 id="syntax-for-switch-statement" style="text-align: justify;">Syntax for switch statement</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">switch(expression){    <br/>case value1:    <br/>//code to be executed;    <br/>break;  //optional  <br/>case value2:    <br/>//code to be executed;    <br/>break;  //optional  <br/>......    <br/>default:     <br/>code to be executed if all cases are not matched;    <br/>}    </code></pre> </div>
<h2 id="flow-chart-for-switch">Flow chart for switch</h2>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4913 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/switch-statement-in-c.png" alt="" width="730" height="590" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/switch-statement-in-c.png 730w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/switch-statement-in-c-300x242.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/switch-statement-in-c-390x315.png 390w" sizes="(max-width: 730px) 100vw, 730px" /></p>
<h2 id="sample-program">Sample Program</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">    #include&lt;stdio.h&gt;<br/><br/>    int main() {<br/>      int number = 0;<br/>      printf(&quot;enter a number:&quot;);<br/>      scanf(&quot;%d&quot;, &amp; number);<br/>      switch (number) {<br/>      case 10:<br/>        printf(&quot;number is equals to 10&quot;);<br/>        break;<br/>      case 50:<br/>        printf(&quot;number is equal to 50&quot;);<br/>        break;<br/>      case 100:<br/>        printf(&quot;number is equal to 100&quot;);<br/>        break;<br/>      default:<br/>        printf(&quot;number is not equal to 10, 50 or 100&quot;);<br/>      }<br/>      return 0;<br/>    }</code></pre> </div>
<h2 id="output">Output</h2>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4916 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/switch-case-examples.jpg" alt="" width="329" height="182" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/switch-case-examples.jpg 329w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/switch-case-examples-300x166.jpg 300w" sizes="(max-width: 329px) 100vw, 329px" /></p>
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-is-switch-statement-in-c-with-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is Static Variable in C ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-is-static-variable-in-c/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-is-static-variable-in-c/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 03 Oct 2022 06:43:13 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[how to implement static variable in c]]></category>
		<category><![CDATA[local static variable in c]]></category>
		<category><![CDATA[local static variables what is their use]]></category>
		<category><![CDATA[scope of static variable in c]]></category>
		<category><![CDATA[static function in c]]></category>
		<category><![CDATA[static in c]]></category>
		<category><![CDATA[static variable example]]></category>
		<category><![CDATA[static variable in c]]></category>
		<category><![CDATA[static variables in c]]></category>
		<category><![CDATA[static variables in c programming language]]></category>
		<category><![CDATA[what is the use of static variable in c]]></category>
		<category><![CDATA[why are static variables used in c]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4907</guid>

					<description><![CDATA[Static variable have a property of preserving their value even after they are out of their scope. Static variable preserve their previous values in their previous scope and are not initialized again the new scope. Syntax Here data_type –&#62; Data types like int, char, float etc. Var_name -&#62; Name of the variable given by user. [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">Static variable have a property of preserving their value even after they are out of their scope.</li>
<li style="text-align: justify;">Static variable preserve their previous values in their previous scope and are not initialized again the new scope.</li>
</ul>
<h2 id="syntax" style="text-align: justify;">Syntax</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">static data_type var_name = var_value;</code></pre> </div>
<ul style="text-align: justify;">
<li>Here <strong>data_type</strong> –&gt; Data types like int, char, float etc.</li>
<li><strong>Var_name</strong> -&gt; Name of the variable given by user.</li>
<li><strong>Value</strong> -&gt; Any value to initialize. By default, it is zero.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4908 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/static-variable-in-c.jpg" alt="" width="751" height="377" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/static-variable-in-c.jpg 751w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/static-variable-in-c-300x151.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/static-variable-in-c-390x196.jpg 390w" sizes="(max-width: 751px) 100vw, 751px" /></p>
<ul style="text-align: justify;">
<li>A static variable remains in the memory while the program is running.</li>
<li>Static variables are allocated memory in data segment, not in stack segment.</li>
<li>Default values of static variables is assigned as 0 if not initialized explicitly.</li>
<li>In C, static variables can be initialized using constant literals.</li>
<li>Static global variables and functions are possible in C. The purpose of these is to limit scope of a variable or function to file.</li>
<li>Static variables cannot be declared inside the structure. The reason is compiler requires the entire structure elements to be placed together.</li>
<li>Memory allocation for structure members should be contiguous.</li>
</ul>
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-is-static-variable-in-c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is Pointer in C ?</title>
		<link>https://www.wikitechy.com/interview-questions/c/what-is-pointer-in-c/</link>
					<comments>https://www.wikitechy.com/interview-questions/c/what-is-pointer-in-c/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Mon, 03 Oct 2022 06:33:50 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[advantage of pointers in c]]></category>
		<category><![CDATA[c++ pointers]]></category>
		<category><![CDATA[c++ pointers with examples]]></category>
		<category><![CDATA[pointer arithmetic in c]]></category>
		<category><![CDATA[pointers in c]]></category>
		<category><![CDATA[pointers in c and c++]]></category>
		<category><![CDATA[what are pointers in c]]></category>
		<category><![CDATA[what is pointer]]></category>
		<category><![CDATA[what is pointer in c programming]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4903</guid>

					<description><![CDATA[For storing the address of another variable pointers can be used. Variables of type int,char, array, function or any other pointer can be of type pointer. Architecture of a pointer determines the size of the pointer. Size of the pointer depends on the architecture. In 32 bit the size of the pointer is 2 byte. [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">For storing the address of another variable pointers can be used.</li>
<li style="text-align: justify;">Variables of type int,char, array, function or any other pointer can be of type pointer.</li>
<li style="text-align: justify;">Architecture of a pointer determines the size of the pointer.</li>
<li style="text-align: justify;">Size of the pointer depends on the architecture.</li>
<li style="text-align: justify;">In 32 bit the size of the pointer is 2 byte.</li>
<li style="text-align: justify;">Using pointer some of programming tasks in C can be easily done.</li>
</ul>
<h2 id="declaring-a-pointer" style="text-align: justify;"><strong>Declaring a pointer</strong></h2>
<p style="text-align: justify; background: white;"><span lang="EN-US" style="font-size: 16.0pt; font-family: 'Segoe UI',sans-serif; color: #333333;">The pointer in c language can be declared using * (asterisk symbol). It is also known as indirection pointer used to dereference a pointer.</span></p>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">int *a; //pointer to int  <br/>char *c;//pointer to char  </code></pre> </div>
<h3 id="pointer-example" style="text-align: justify;">Pointer Example:</h3>
<p style="text-align: justify;">An example of using pointers to print the address and value is given below.</p>
<p style="text-align: justify;">
<p style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4904 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-pointer-in-c.jpg" alt="" width="595" height="297" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-pointer-in-c.jpg 595w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-pointer-in-c-300x150.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/what-is-pointer-in-c-390x195.jpg 390w" sizes="(max-width: 595px) 100vw, 595px" /></p>
<h3 id="pointer-to-array" style="text-align: justify;"><strong>Pointer to array</strong></h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">int arr[10];  <br/>int *p[10]=&amp;arr; </code></pre> </div>
<h3 id="pointer-to-a-function" style="text-align: justify;"><strong>Pointer to a function</strong></h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">void show (int);  <br/>void(*p)(int) = &amp;display; </code></pre> </div>
<h3 id="pointer-to-structure" style="text-align: justify;"><strong> </strong><strong>Pointer to Structure</strong></h3>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-c code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-c code-embed-code">struct st {  <br/><br/>   int i;  <br/><br/>    float f;  <br/><br/>}ref;  <br/><br/>struct st *p = &amp;ref;  </code></pre> </div>
<p style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4905 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/pointer-to-structure.png" alt="" width="303" height="96" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/pointer-to-structure.png 303w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/10/pointer-to-structure-300x96.png 300w" sizes="(max-width: 303px) 100vw, 303px" /></p>
<h2 id="advantages-of-pointer" style="text-align: justify;">Advantages of Pointer</h2>
<ul style="text-align: justify;">
<li>Pointer reduces the code and improves the performance.</li>
<li>It is used to retrieving strings, trees, etc., and used with arrays, structures, and functions.</li>
<li>We can return multiple values from a function using the pointer.</li>
<li>It makes you able to access any memory location in the computer&#8217;s memory.</li>
</ul>
<h2 id="usage-of-pointer" style="text-align: justify;">Usage of pointer</h2>
<p style="text-align: justify;">There are many applications of pointers in c language.</p>
<p style="text-align: justify;"><strong>Dynamic memory allocation</strong></p>
<ul style="text-align: justify;">
<li>In C language, we can dynamically allocate memory using malloc() and calloc() functions where the pointer is used.</li>
</ul>
<p style="text-align: justify;"><strong>Arrays, Functions, and Structures</strong></p>
<ul style="text-align: justify;">
<li>Pointers in c language are widely used in arrays, functions, and structures.</li>
<li>It reduces the code and improves the performance.</li>
</ul>
<p style="text-align: justify;">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/c/what-is-pointer-in-c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
