C Programming Notes
C Programming Notes
Computer Generation:
1st Generation: 1946 Digital Computer
2nd Generation: 1955 Vacuum Based
3rd Generation: 1965 IC (Integrated Circuit) Based
4th Generation: 1974 Micro IC Based
5th Generation : 1984 to till now: Artifical Intelligent
Computer Programming:
1. Low Level Language:Machine Laguage base binary: 0 and 1
2. Middle Level Language: Assembly Language base of maths add, sub, div, mul Ex.
COBOL , BASIC, FORTRON,
Structure of C Programming:
1. Include Header file
2. main function()
3. Declare Variable
4. Programming Statment (Logical)
{ Statement 1, statement 2..statment n }
5. Output
Syntax Programme:
#include<stdio.h> 1. standard input and output header file
#include<conio.h> console input and output header file
void main() 2.
{
Declare the variable a,b,c,d,e 3
Programming Logic: (Statement 1, 2,3,...n)
// First Progrmme
#include<stdio.h> // include header file: standard input and output header file
int main() // main is function
{ // starting the function
printf("Hello world"); //statement1 print
return 0; // return the value
}
// closeing of function
Rules of writing of C Programming:
1. All keywords are lowere case
2. c is case sesitive language.
3. dont use keywords like as for, if, else, while, do while, exit, continue..
4. give the comment a. // single line b. /* Multiline comment */
5. main() is always the first fucntion called when programme excution.
step 1: start
step 2: input three variable
step 3: declare variable a,b,c
step 4: Logic: c=(a+b);
step 5: print "Addition of two numbers:" c
step 6: stop
step 1: start
step 2: input three variable
step 3: declare variable a,b,c
step 4: Logic: c=(a*b);
step 5: print "Multiplicaiton of two numbers:" c
step 6: stop
step 1: start
step 2: input three variable
step 3: declare variable a,b,c
step 4: Logic: c=(a-b);
step 5: print subtraction of two numbers:" c
step 6: stop
step 1: start
step 2: input three variable
step 3: declare variable a,b,c
step 4: Logic: c=(a/b);
step 5: print "Divsion of two numbers:" c
step 6: stop
step 1: start
step 2: input four variable
step 3: declare variable a,b,c,d
step 4: Logic: d=(a*b*c);
step 5: print "Multiplicaiton of three numbers:" d
step 6: stop
step 1: start
step 2: input six variable
step 3: declare variable a,b,c,d,e,avg
step 4: Logic: avg=(a+b+c+d+e)/5;
step 5: print "Average of numbers:" avg
step 6: stop