C Programming tips and tricks

How to write C program
  1. Write down the header file (stdio.h, string.h, math.h, stdlib.h)
  2. Write main() functions
  3. Variable declaration
    1. 1st Data Type Selection
    2. Selecting suitable varaible name
  4. Ask for values - printf(output) , scanf(input)
  5. Perform the task (process)
  6. Display the result (printf)

Header file - stdio.h

Data Type Selection
Number, Registration Number, Employee ID, Student ID , Marks obtained in exam (Whole Number)
int %d
area of circle, value of π=3.14
float %f
Simple if statement
One condition and one statement for true . It works with goto statement
if -else statement
One condition - two statement each one for true and false Example: Odd/ Even , Prime/ Composite Detection
if else if statement
Two or more than two conditions Example: Grading System, Awarding Division based on percentage
nested if else
If we have to check one condition and within it another condition like nest ; Example : Division will be only awarded to the pass student.