C Program to find Square Root of a Number


#include <stdio.h>
#include <conio.h>
#include <math.h>
int cuberoot(int c);

void main()
{
    int a , b;
    printf("enter number :");
    scanf("%d",&a);
  // b = a * a;
   b = cuberoot(a);
   printf("cube root is %d",b);
  getch();

}

int cuberoot(int c)
{
    int m,a1;
    int i;
    
    for(i=1;i<c;i++){
        m = i * i * i;
        if(m==c){
            a1 = i;
        }
    }
   return a1;

}

Comments

Popular posts from this blog