arithmetic operations

#include<stdio.h>
int main() {
    int a,b,c;
    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);
    printf("modulo div is %d:\n ",a%b);
    return 0;
}
Input:
2 3
Output
sum is 5:
 sub is -1:
 mul is 6: 
div is 0:
 modulo div is 2:

No comments:

Post a Comment