Icons
Questions
Snippets
Write a program to calculate the value of the given expression: (a+b)3. Take the values of a, b as input from the console.
#include<stdio.h>
void main() {
int a,b,x;
printf("Enter the value of a\n");
scanf("%d", &a);
printf("Enter the value of b\n");
scanf("%d", &b);
x = (a*a*a) + (b*b*b) + (3*a*a*b) + (3*b*b*a);
printf("%d", x);
}