Sunday 28 December 2014

Program to add,subtract.multiply and divide any numbers

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main()

{
    int x, y ;
   
    printf("enter first value:");
    scanf("%d", &x);
    printf("enter 2nd value:");
    scanf("%d", &y);
   
    printf("sum=%d \n", x+y);
    printf("subtraction=%d \n", x-y);
    printf("multiplication=%d \n", x*y);
    printf("divisin=%d \n", x/y);
   
    system("PAUSE");
    return 0;
}

No comments:

Post a Comment