Square Root without using Math.h sqrt Function
#include<stdio.h>
#include<stdlib.h>
int main(int argc, char *argv[])
{
if(argc==1)
{
printf(“No arguments”);
return 0;
}
else
{
int n;
n=atoi(argv[1]);
float i=0.00;
while(i*i<=n)
{
i=i+0.001;
}
i=i-0.001;
printf(“%.2f”,i);
}
}
[/code]
One Subscription, For Everything
The new cool way of learning and upskilling -
One Subscription access everything
Get Access to PrepInsta Prime
from FAANG/IITs/TOP MNC's
PrepInstaPrime
Get over 200+ course One Subscription
Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.
Login/Signup to comment