LEARN THE BASIC “C” PROGRAMS

I am very glad to post this topic on “C” language, as I am big fan of “C” language. Although you might have basic knowledge about “c” but still I am giving you few basic programs who are on a verge to start their carrier in “ C”. Learn the basic “C” in one day! First of all you should have TURBO C SOFTWARE install on your pc.
Tips for beginners:
1.Every program of “C” starts with main() Every instruction ends with semicolon ;
2. main() is nothing but the main program inside which the instruction to execute certain task will be written within curly bracket that is main() { }.
3. scanf instruction is use to read data entered on screen in any variable like s4,f5,j,o… depending upon the prototype defined that is %d for integer %f for float.And the data is scanned by ‘&’ that is address.
4.printf is exactly opposite to scanf, used to display data on screen.
5.getch() is used to hold the screen until any key is pressed.
6.Initially we have to define the variable is integer or float or anything else by int float like default key words. Here is the program to add two nos…
main()
{ int a,b,c;
clrscr();
printf(“enter the number”);
scanf(“%d%d”,&a,&b);
c=a+b;
printf(“addition=%d”,c); getch();
}
Here is the program to subtract two nos…
main()
{ int a,b,c; clrscr();
printf(“enter the number”);
scanf(“%d%d”,&a,&b);
c=a-b;
printf(“subtraction=%d”,c);
getch();
}
Here is the program to multiply two nos…
main()
{ int a,b,c;
clrscr();
printf(“enter the number”);
scanf(“%d%d”,&a,&b);
c=a*b;
printf(“multiplication=%d”,c); getch();
}
Similerly you can do for others. If you want to directly copy these program. Create a new text document copy n paste a program to it. Rename that file as .c extension now go to turbo c open that file n run it!

