Aug 30, 2024
// comment
/* comment */
#include
directive.#include <stdio.h>
for standard input/output functions.printf
, scanf
) are defined in header files.#include <math.h>
for mathematical functions.#include <string.h>
for string functions.#define
.#define PI 3.14
int a;
declared outside any function can be used in all functions.main
function.void main() { }
main
function when the program is executed.main
function.#include <stdio.h>
void main() {
printf("Hello World\n");
getch();
}
// Documentation section
#include <stdio.h>
#define MAX 100
void display(); // Function declaration
int main() {
int a = 50; // Declaration part
printf("Hello\n"); // Executable part
display(); // Calling user-defined function
getch();
}
void display() { // Function definition
printf("Jenny's Lectures\n");
}
main
, prints "Hello".display
, prints "Jenny's Lectures".main
.