Flow of C Progam
The C program follows many steps in execution. To understand the flow of C program well, let us see a simple program first. file.c#include <stdio.h> void main( ) { printf("hello catchmecoder"); }

printf scanf in C
The printf() and scanf() functions are used for input and output in C language. Both functions are inbuilt library functions, defined in stdio.h (header file).
printf() function
The printf() functionis used for output. It prints the given statement to the default i/o device console. The syntax of printf() function is given below:
printf("format string",argument_list);
The format string can be %d (integer), %c (character), %s (string), %f (float), %u(unsigned),..etc.
Scanf() function
The scanf() function is used for input. It reads the input data from the console.
scanf("format string",argument_list);
Program to print square of 2 numbers
Let's see a simple example of input and output in C language that prints square of 2 numbers.
#include <stdio.h> void main( ) { int number; printf("enter a number:"); scanf("%d",&number); printf("square of number is:%d ",number*number); } Output: enter a number:10 square of number is:100
Program to print sum of 2 numbers
Let's see a simple example of input and output in C language that prints addition of 2 numbers.#include <stdio.h> void main( ) { int x = 0, y = 0, result = 0; printf("enter first number:"); scanf("%d",&x); printf("enter second number:"); scanf("%d",&y); result=x+y; printf("sum of 2 numbers:%d ",result); } Output: enter first number: 10 enter second number: 12 sum of 2 numbers: 22