Saturday, September 1, 2012

c language program examples


Write C program to declare two variable named a and b with some integer value and print the addition subtraction, multiplication and division of this two numbers 


#include<stdio.h>
#include<conio.h>
void main()
{
        int a,b,c;
        clrscr();


        a=20;
        b=10;
        

        c=a+b;
        printf("\n Addition of a and b = %d",c);
        

        c=a-b;
        printf("\n\n Subtration of a and b = %d",c);
 

        c=a*b;
        printf("\n\n Multiplication of a and b = %d",c);
    

        c=a/b;
        printf("\n\n Division of a and b = %d",c);
        getch();
}

No comments:

Post a Comment