by CodeChum Admin
Now this one's a tad bit tricky, but you can definitely do it!
Instructions:
Input
1. First integer
2. Second integer
3. Third integer
4. Fourth integer
5. Fifth integer
Output
The first five lines will contain message prompts to input the five integers.
The line contains the result.
Enter·integer·1:·2
Enter·integer·2:·3
Enter·integer·3:·3
Enter·integer·4:·5
Enter·integer·5:·4
Result·=·2560000
#include <stdio.h>
#include <math.h>
int main() {
int i1, i2, i3, i4, i5;
int sum1, sum2, prod, res;
printf("Enter first integer: ");
scanf("%d", &i1);
printf("Enter second integer: ");
scanf("%d", &i2);
printf("Enter third integer: ");
scanf("%d", &i3);
printf("Enter fourth integer: ");
scanf("%d", &i4);
printf("Enter fifth integer: ");
scanf("%d", &i5);
sum1 = i1 + i2;
sum2 = i3 + i4;
prod = sum1 * sum2;
res = pow(prod, i5);
printf("Result = %d\n", res);
return 0;
}
Comments
Leave a comment