Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to calculate square of a given number

Posted By: Rachel Barnes     Category: C Programming     Views: 27373

Write a program to calculate square of a given number

Code for Program to calculate square of a given number in C Programming

#include<stdio.h>
    #include<conio.h>
    void main()
    {
        int n,sqr=0;
        clrscr();
        printf("\n\t ENTER THE NO.:= ");
        scanf("%d",&n);
        sqr=n*n;
        printf("\n\t SQUARE OF %d is %d .",n,sqr);
        getch();
    }


*********************** OUTPUT ***********************************************

    ENTER THE NO.:= 12

    SQUARE OF 12 is 144 .

*****************************************************************************
  
Share: 


Didn't find what you were looking for? Find more on Program to calculate square of a given number Or get search suggestion and latest updates.

Rachel Barnes
Rachel Barnes author of Program to calculate square of a given number is from Hampton, United States.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!