3.Operators in C
#include<stdio.h>
#include<math.h>
int main(){
    int a,b;
    printf("Enter the first value:");
    scanf("%d",&a);
    printf("Enter the second value:");
    scanf("%d",&b);
    printf("The addition is:%d\n",a+b);
    printf("The subtraction is:%d\n",a-b);
    printf("The multiplication is:%d\n",a*b);
    printf("The division is:%d\n",a/b);
    printf("The remainder of 8 divided by 5 is :%d\n",8%5);
    // how to calculate the power
    printf("The value of 4 to the power 5 is %f",pow(4,5));
    return 0;
}
Comments
Post a Comment