Tuesday, 30 June 2015

Program 2 : Write a program that reads two nos. from key board and gives their addition, subtraction, multiplication, division and modulo

#include<stdio.h>

//#include<conio.h> : only required when you are run program in Turbo C

void main() {

    int a, b;

    printf(“Enter the two no for calculate / n”);

    scanf(“ %d, %d”, &a, &b);

    printf(“Sum is : %d / n”, (a + b));

    printf(“Sub is : %d / n”, (a - b));

    printf(“Mul is : %d / n”, (a * b));

    printf(“Div is : %d / n”, (a / b));

    //getch();  : only required when you are run program in Turbo C

}

No comments:

Post a Comment