Lets Start C programming

                  Lets start our first program. Before it you need a compiler to compile our program. Commonly used C compiler is Turbo C (* It's not working in windows vista or windows 7. But can work using some techniques). Click here to download C compiler will not working  in windows 7 or in vista.
First of all we need to know some keywords to communicate with computer.

****The downloaded file must save in c drive of your computer.****
Then open TC/BIN/TC.EXE.

Some basic C commands are :-
 Printf  :- To print something
               eg. printf("Something to display")
Scanf  :- To accept some inputs.
               eg. scanf("%d",a);
               * Here %d is used for show a is an intiger.

Some Data type 





Data Type
Range
Data Type
Range
char or signed char
-128 to 127
unsigned char
0 to 255
int or signed int
-32768 to 32767
unsigned int
0 to 65535
long int or signed int
-2147483648 to 2147483647
unsigned long int
0 to 4294967295


C program
#include <stdio.h>
main ()
{
statements
}

  A basic c program is just like like above. Here the #include<stdio.h> is header file. Here stdio.h is standard input output functions. Many functions are there to work different functions like math.h , conio.h etc..

Then the main() part is to indicate the main function starts here.
We give statements with in { }.

Comments

Popular posts from this blog

Algorithm to display "n" natural numbers #c

Algorithm to display the sum of n natural numbers #c

Algorithm for Sum of two numbers