answersLogoWhite

0


Best Answer

#include <stdio.h>

#include <conio.h>

void main()

{

int n=0;

printf("\n\nEnter a number: ");

scanf("%d", &n);

n=n*n;

printf("\nThe square is %d ", n);

getch();

}

BY: Eng . Ali Saed

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

#include<iostream> int main()

{

double x=rand();

std::cout<<"The square root of "<<x<<" is "<<sqrt(x)<<std::endl;

}

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

public class Test {

public static void main(String[] args){

int x = 10;

System.out.println("Square value = " + (x * x));

}

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write program to calculate square of an integer?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program that input a positive integer and prints a triangle using for loop?

write a program that reads in the size of the side of square and then pints a hollow square of that size out of asterisks and blanks?


Write a program to subtract integer y from integer x?

x -=y;


How do you write Square program using vb?

write a vb program to find the magic square


Write a program to calculate first?

int first= 1;


How do you Write A program in c language for checking a diagonal matrix?

Write a program in c++ that take input in a integer matrix of size 4*4 and find out if the entered matrix is diagonal or not.


How do you Write a C program to reverse an Integer number.?

Reference:cprogramming-bd.com/c_page2.aspx# reverse number


How do you write a C Program to fill up an Integer Array?

Reference:cprogramming-bd.com/c_page1.aspx# array programming


Write a c program to accept a numbers and generate square root cube and exponential values?

write a c program to accept a number and generate a square root cube and exponential values


How do you write a vbscript for converting alphanumeric to numeric?

num = InputBox("Enter a number: ","PROGRAM: Square") sumSquare = CInt(num) * CInt(num) MsgBox("The square of " &amp; num &amp; " = " &amp; sumSquare) ===== *NOTE*: The function CInt() is what we use to convert a text string to become a numeric integer value.


How is the the square root of 5 incommensurable?

I am not sure whether the term "incommensurable" is appropriate here; the official term is "irrational", which means it can't be expressed exactly as a ratio: you can't write a fraction with integer numerator and denominator which is exactlyequal to the square root of 5 (or of any other integer that is not a perfect square) - but you can obviously get very close to the exact value with such a fraction. If you write the square root of 5 as a decimal, you will get an infinite amount of decimal digits, which will not repeat.I am not sure whether the term "incommensurable" is appropriate here; the official term is "irrational", which means it can't be expressed exactly as a ratio: you can't write a fraction with integer numerator and denominator which is exactlyequal to the square root of 5 (or of any other integer that is not a perfect square) - but you can obviously get very close to the exact value with such a fraction. If you write the square root of 5 as a decimal, you will get an infinite amount of decimal digits, which will not repeat.I am not sure whether the term "incommensurable" is appropriate here; the official term is "irrational", which means it can't be expressed exactly as a ratio: you can't write a fraction with integer numerator and denominator which is exactlyequal to the square root of 5 (or of any other integer that is not a perfect square) - but you can obviously get very close to the exact value with such a fraction. If you write the square root of 5 as a decimal, you will get an infinite amount of decimal digits, which will not repeat.I am not sure whether the term "incommensurable" is appropriate here; the official term is "irrational", which means it can't be expressed exactly as a ratio: you can't write a fraction with integer numerator and denominator which is exactlyequal to the square root of 5 (or of any other integer that is not a perfect square) - but you can obviously get very close to the exact value with such a fraction. If you write the square root of 5 as a decimal, you will get an infinite amount of decimal digits, which will not repeat.


Write a program to compute the sum of first ten integer numbers in PHP?

$n = 10*(1+10)/2;


Is square root 11 an integer or fraction?

Answer: Mixed number Answer: It is neither, in the sense that you can't write the square root of any positive integer (except for the square root of perfect squares) exactly as a fraction. You can only approximate it. In other words, it's an irrational number.