Code for calculating
square root without
using library function,
of math.h
Answer Posted / abhinav dwivedi
#include<stdio.h>
#include<conio.h>
void main()
{
int num,i;
clrscr();
printf("enter no to find square root");
scanf("%d",&num);
for(i=1;i<=num/2;i++)
{
if(num/i==i && num%i==0)
{
printf("square root of entered no is %d",i);
break;
}
else
{
continue;
}
}
if(num/i!=i)
printf("their is no perfect suare root of entered no");
}
| Is This Answer Correct ? | 10 Yes | 9 No |
Post New Answer View All Answers
What is realloc in c?
struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
Why main is used in c?
Can include files be nested? How many levels deep can include files be nested?
What is self-referential structure in c programming?
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)
Where define directive used?
What is the use of f in c?
Why void main is used in c?
What is spark map function?
Is c easier than java?
What is array in C
Write a code to remove duplicates in a string.
What should malloc(0) do?