Loading content...
Loading content...
<h2 style="font-size:32px;color:#5B21B6;font-weight:700;margin-bottom:15px;">C Language Introduction</h2>
<p style="font-size:16px;line-height:1.8;color:#444;">
C is a general-purpose procedural programming language. It is known for its high performance, efficiency, and low-level memory access. Due to its speed, portability, and close interaction with hardware, C is widely used in system programming, embedded systems, and performance-critical applications.
</p>
<h2 style="font-size:28px;color:#5B21B6;font-weight:700;margin-top:35px;">First C Program</h2>
<pre style="background:#1E293B;color:#F8FAFC;padding:18px;border-radius:8px;overflow:auto;font-size:15px;"><code>#include <stdio.h>
int main(){
printf("Hello World");
return 0;
}</code></pre>
<h3 style="font-size:22px;color:#111827;margin-top:25px;">Output</h3>
<pre style="background:#F8FAFC;border-left:4px solid #5B21B6;padding:15px;font-size:15px;"><code>Hello World</code></pre>
<h2 style="font-size:28px;color:#5B21B6;font-weight:700;margin-top:35px;">Structure of a C Program</h2>
<h3 style="font-size:22px;color:#111827;">1. Header File Inclusion</h3>
<pre style="background:#1E293B;color:#F8FAFC;padding:18px;border-radius:8px;overflow:auto;font-size:15px;"><code>#include <stdio.h></code></pre>
<p style="font-size:16px;line-height:1.8;color:#444;">
Header files contain function declarations and macro definitions that can be used in a program. The <strong>#include</strong> directive tells the preprocessor to include the contents of the specified header file before compilation.
</p>
<h3 style="font-size:22px;color:#111827;">Common Header Files</h3>
<table style="width:100%;border-collapse:collapse;margin:20px 0;">
<thead>
<tr style="background:#5B21B6;color:#fff;">
<th style="padding:12px;border:1px solid #ddd;text-align:left;">Header File</th>
<th style="padding:12px;border:1px solid #ddd;text-align:left;">Purpose</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding:12px;border:1px solid #ddd;">stdio.h</td>
<td style="padding:12px;border:1px solid #ddd;">Input and output functions</td>
</tr>
<tr>
<td style="padding:12px;border:1px solid #ddd;">stdlib.h</td>
<td style="padding:12px;border:1px solid #ddd;">Memory management and utility functions</td>
</tr>
<tr>
<td style="padding:12px;border:1px solid #ddd;">string.h</td>
<td style="padding:12px;border:1px solid #ddd;">String handling functions</td>
</tr>
<tr>
<td style="padding:12px;border:1px solid #ddd;">math.h</td>
<td style="padding:12px;border:1px solid #ddd;">Mathematical functions</td>
</tr>
<tr>
<td style="padding:12px;border:1px solid #ddd;">stdint.h</td>
<td style="padding:12px;border:1px solid #ddd;">Fixed-size integer data types</td>
</tr>
<tr>
<td style="padding:12px;border:1px solid #ddd;">stddef.h</td>
<td style="padding:12px;border:1px solid #ddd;">Standard type definitions and macros</td>
</tr>
</tbody>
</table>
<h3 style="font-size:22px;color:#111827;">2. Main Function</h3>
<pre style="background:#1E293B;color:#F8FAFC;padding:18px;border-radius:8px;overflow:auto;font-size:15px;"><code>int main()</code></pre>
<p style="font-size:16px;line-height:1.8;color:#444;">
The <strong>main()</strong> function is the starting point of every C program. Program execution begins from this function.
</p>
<ul style="line-height:2;">
<li><strong>int</strong> specifies the return type of the function.</li>
<li><strong>main()</strong> is the function name.</li>
<li>Empty parentheses indicate that no arguments are passed.</li>
</ul>
<h3 style="font-size:22px;color:#111827;">3. Function Body</h3>