Saturday, 29 June 2013

CLASS 2 FOR C PROGRAMMING

Now we can learn how to use operators in c program.
+,-,*,/ are operators.So we can add,subtract,multiply and two or more numbers.

The logic for the program:
#include<stdio.h>
#include<conio.h>
void main()
{
 int a=10,b=5,c;
clrscr();
c=a+b;
printf("sum;%d",c);
getch();
}
You will get output as 15.
You can choose any value of a and b.
int a=10,b=5.c; is called declaration.
You can use same logic for rest operators.



MASTER C LANGUAGE

Friends i am here to help you to master c language.

First i would tell you some facts about c language:

The C programming language is a computer  programming language that was developed to do system programming for operating system UNIX.C was developed in 1972 by Ken Thompson and Dennis Ritchie.
C is compiled language.



Now we will begin to learn c language .


The first step is to download turbo c .
For windows 7 user they can download from http://turboc-7-by-akki.software.informer.com/

Now every c program starts with adding 2 header file  i.e stdio.h and conio.h.
So the first 2 statements of the program are :
#include<stdio.h>
#include<conio.h>
Next we write a function void main and then we write the body of program.
We write clrscr to get clear screen for the output.
The program ends with getch which is required to get output.

Here is an example of  primitive program:

#include<stdio.h>
#include<conio.h>
void main()
{
 clrscr();
  printf("shaunak");
  getch();
}
Then press ctrl+f9 to get output .
You will get output as: shaunak .You will get output as the text you write in ("   ").
Press enter to return back.
I hope u can now try for printing your name and profile.

NOTE: refer to next post for next info.