-
Program for finding cubic root of a number
How to write program for finding cubic root of a number?
Question asked by visitor vidhya
-
Junior Member
Re: Program for finding cubic root of a number
main()
{
//read the value n;
for(i=1;i<=n;i++)
{
a=i*i*i;
if(a==n)
cout<<"cubic root is "<<a;
}
}
-
Junior Member
Re: Program for finding cubic root of a number
#include<iostream.h>
#include<conio.h>
#include<math.h>
main(void)
{ int i,c,n;
cout<<"enter a no\n";
cin>>n;
for(i=1;i<=n;i++)
{ c=i*i*i;
if(c==n)
{ cout<<"cube root:"<<i;
break;}
}
cout<<"out of loop ans got\n";
getch();
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules