Write a program to find the value of y for a particular value of n. The a, x, b, n is input by user
#include<stdio.h>
#include<conio.h>
int main ()
{
int a,x,b,n,y;
printf("enter the values of a, x,b,n");
scanf("%d%d%d%d",&a,&x,&b,&n);
if (n==1)
y=(a*x)%b;
if (n==2)
y=(a*x*x)+(b*b);
if (n==3)
y=a-b*x;
if (n==4)
y=a+(x/b);
printf("value of y is :%d",y);
getch();
return 0;
}
enter the values of a, x,b,n10
20
30
2
value of y is :4900
--------------------------------
Process exited after 9.402 seconds with return value 0
Press any key to continue . . .