Divide that number into 2 using modulus division. Modulus division get the remainder of the division. If it has no remainders, then it's an even number. If not, then it's an odd number. Here's a pseudo code of the program.
ALGORITHM ODD_EVEN
INPUT (number)
IF (number MOD 2 == 0) THEN
DISPLAY ("Even")
ELSE
DISPLAY ("Odd")
END IF
END ODD_EVEN
Amendment: You did ask for a BASIC program:
10 INPUT X: IF X = 999 THEN STOP
20 PRINT X;: IF X/2 = INT(X/2) THEN PRINT "EVEN" ELSE PRINT "ODD"
30 GOTO 10
#include<stdio.h> int main() { int side,area of square; print f("Enter the length of side\n"); scan f("%d",&side); area of square=side*side; print f(the area of square is %d\n"area of square); return 0; }
write a vb program to find the magic square
Example: int x, y; x = 5; y = x * x; // square of x System.out.println("The square of " + x + " = " + y); Put all this in your main() method. Most Java IDEs will generate the main() method automatically.
It should not be even (except for 2), and must not be dividable with any odd number between 3 and its square-root.
#include <stdio.h> void main() { int a,b,c,i,j; printf("Enter the number of rows for square matrix : "); scanf("%d",&a); for(i=1;i<=a;i++) { for(c=1,j=1;j<=a;j++,c++) { if(c==i) printf("1 "); else printf("0 "); } printf("\n"); } getch(); }
It depends on the type of calculator you have. If you have a 8-digit calculator, the largest square number you can display is 99,980,001. If you have a 10-digit calculator, the largest square number you can display is 9,999,800,001. With a TI-84, you can display 9.999999999e99 (which is actually rounded).
if it's square root is an integer, it is a square number.
You can tell whether a number is a square number by looking at the last digit. A perfect square number ends with either 1, 4, 5, 6, 9 or 00.
square and cube caculator
Try it out. Take the square root on a calculator, and see whether you get a whole number.
If your question is whether or not 177 has a square root which is an integer, then no.
WordPad is not meant to handle the typesetting and display of mathematical expressions. You can use this radical symbol: √ to display simple square roots, but you can't extend the mark above the thing you're taking the square root of. To display more complex expressions, you need a program like MathType, which is specifically designed to typeset math.
Two, a square and a trapezoid. A square is a rectangle and a parallelogram.
If the whole number is a perfect square, its square root is rational. If not, it's not.
Click the numbers to display "453" (the number of sides to square, pentagon, triangle).
#include<stdio.h> int main() { int side,area of square; print f("Enter the length of side\n"); scan f("%d",&side); area of square=side*side; print f(the area of square is %d\n"area of square); return 0; }
If it can't be expressed as a fraction then it is an irrational number