A Program is a set of instructions, which can be executed and the desired results can be obtained……
Let us see something about C language. C is a robust language which can be used in writing complex programs, because it has some built in functions and operators.... Programs written in c are efficient and fast. Another important feature of C language is, the program written for one computer can be used in another without any modification...
The basic data type of c language is as follows...
Data Type
int float double char
%d %f %f, %g, %e %c
The range of these data types are as follows…..
1. Short int – -127 to 128
2. Signed int - -32767 to 32768
3. Long int - 231 – 1
4. Unsigned int – 0 to 65535
The basic structure of the C program will be like this………
#include
#define
main( )
{
Variable declarations;
Function prototype;
Program statements;
}
There are some basic rules for forming a variable.
1. First letter of the variable should be an alphabet or underscore
2. It can be a combination of alphabets, digits and underscore
3. It should not be a keyword ( like int, float etc.,)
4. It should be unique
5. The length of the keyword should be maximum 31 characters, if it exceeds 31, it will be discarded.
With the above said things we can write a small C program to add to numbers…
#include
{
int a, b, c; variable declaration.
a = 5;
b = 6; adding a and b
c = a+b;
printf (“c = %d”, c); printing the value of c
}
with the same example we can try some more programs on our own like subtraction, multiplication and division…
3 comments:
Very informative!!!
Thank you
Very, very valuable information to every graduates aspiring for jobs. C rules campus placements.
Post a Comment