C Program to find Square of a Number

In this tutorial you will learn about the C Program to find Square of a Number and its application with practical example.

C Program to find Square of a Number

In this tutorial, we will learn to create a C program that will find the square of a Number in C programming.

Prerequisites

Before starting with this tutorial, we assume that you are the best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • Arithmetic operations in C Programming.

What is a square of a number?

The Square of any number means a number multiplied by itself 2 times. This can also be called ‘a number squared’. The symbol for square is 2 {the power of any number is 2 for square}.

Algorithm:-

Program to Calculate the Square of a Number

In this program, we will take a number in input from the user. Then we will multiply that number by itself 2 times. After that, we will print the resultant answer to the user as an output.

With the help of this program, we can Square a number.

Output:-

In the above program, we have first initialized the required variable.

  • no = it will hold the integer value.
  • sq = it will hold the integer value.

Taking input number from the user to find the Square.

Calculating the Square of that number.

Printing output Square for that given number.

In this tutorial we have learn about the C Program to find Square of a Number and its application with practical example. I hope you will like this tutorial.