C Program to Find k'th root of a number in C | C assignments to find kth root of given number
#include
#include
main()
{
printf ("*********a program to find k'th root of x ....\n\n");
char c;
float i,j,k,m;
do
{
printf ("To get k'th root of x ....\n");
printf ("type the values .....\n\n");
printf ("x= ");
scanf("%f",&i);
printf ("k= ");
scanf("%f",&k);
j=pow(i,(1/k));
printf("\n %dth root of%f = %f\n\n\n",(int)k,i,j);
printf("do you want to try more? y/n \t");
fflush(stdin);
c=getchar();
}while(c=='y');
}
No comments:
Post a Comment