Created
January 5, 2018 11:54
-
-
Save rizwansoaib/6a767540dc0b66b4b1bb93e0675360be to your computer and use it in GitHub Desktop.
To find squareroot of number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in line 15: check**