C program to find square root of a number.

Posted by Mangesh on April 11, 2018

/* program to square root of the number. */

Description :

Square root of a number is a number who's product by itself returns that number. example square root of 4 is 2, as 2 * 2 = 4.

Logic :

We shall use predefine function sqrt() by include the math file.

Program :

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
  int number;
  printf("Enter the number :");
  scanf("%d",&number);
  printf("Square root of number : %f.",sqrt(number));
  getch();
}

Output :

C program for square root Executed and Tested in Turbo C 3.2

Written with from Mangesh.

Related Post
1 C program to get date.
2 C program for Hello World.
3 C program to swap two number without third extra variable.
4 C program to find square root of a number.
5 C program for printing random number.
Latest Post
1 C program to implement Queue using linked list.
2 C program for binary search tree (BST).
3 C program to search an element in linked list.
4 C program for postorder traversal in binary tree.
5 C program for preorder traversal in binary tree.