Skip to content

Instantly share code, notes, and snippets.

@rizwansoaib
Created January 5, 2018 11:54
Show Gist options
  • Save rizwansoaib/6a767540dc0b66b4b1bb93e0675360be to your computer and use it in GitHub Desktop.
Save rizwansoaib/6a767540dc0b66b4b1bb93e0675360be to your computer and use it in GitHub Desktop.
To find squareroot of number
#include <stdio.h>
int sqr(int x)
{
int i=1;
int j;
while(j<=x)
{
j=i*i;
i++;
}
return i-2;
}
void main()
{
printf("enter number to chaeck squreroot");
int x;
scanf("%d",&x);
printf("\n%d is squareroot of %d",sqr(x),x);
}
@rizwansoaib
Copy link
Author

To find squareroot of number

@igoreon
Copy link

igoreon commented Jan 5, 2018

in line 15: check**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment