#include<iostream>
using namespace std;
int main(void)
{
int a;
int b;
{
cout << "Please enter a number: ";
cin >> a;
b = a%2 == 0 ? a*a : a*a*a;
cout << "The result is: " << b << endl;
}
return 0;
}
- - -
//Alternative
#include<iostream>
#include<cmath>
num = int(input("Enter a number: ")) if num % 2 == 0: print("Square of", num, "is", num2) else: print("Cube of", num, "is", num3)
1 CLS 2 PRINT "Please to tell me the length of the side of the square." 3 INPUT S 4 PRINT 5 PRINT "The perimeter of the square is "; 4 * S 6 PRINT 7 PRINT "The area of the square is "; S ^ 2 8 PRINT 9 PRINT "That was truly a total blast. Would you like to play again ? 'Y' or 'N' ." 10 INPUT A$ 11 IF A$ = "Y" or A$ = "y" then PRINT "Goody! " : GOTO 2 12 IF A$ = "N" or A$ = "n" then PRINT "Well OK then. Goodbye": END 13 PRINT: PRINT "Please to type a 'Y' to play again, or a 'N' to quit for now." 14 GOTO 10
If you are referring to this in terms of programming, then let's say I built a pgm that will prompt you to input an integer and my pgm will return the square of your "input"Looks like this:Enter a number and I will square it: 1212 squared = 144Here it is in C++ //input-output stream STL //to make sure i dont need to reinvent the wheelint input_number; //allocate memory for the inputint square; //same for the outputint main{cout >input_number;square = input_number^2;cout
1 PRINT "Kindly enter your next number, Master, or 'x' to end and total them up." 2 INPUT a$: IF a$ = "x" or a$ = "X" then GOTO 10 3 K = VAL(a$) 4 If K<0 then neg=neg+1: PRINT: GOTO 1 5 If K>0 then pos=pos+1: PRINT: GOTO 1 6 If K=0 then Z=z+1: PRINT: GOTO 1 10 PRINT: PRINT "Thank you, Master. I cannot express the joy that this exercise has brought me. Here are your results: " 11 PRINT: PRINT "The number of positive numbers you entered was "; pos; "." 12 PRINT: PRINT "The number of negative numbers you entered was "; neg; "." 13 PRINT: PRINT "The number of zeros you entered was "; Z; "." 15 PRINT: PRINT: PRINT "Would you like to play again, Master ?" 16 PRINT "Kindly touch 'x' if no, or any other key if yes. I can hardly wait." 17 Input a$: IF a$ <> "X" and a$ <> "x" then GOTO 20 18 PRINT: PRINT "It has been my pleasure to cavort with you today, Master." 19 PRINT "Y'all come back now, y'hear !" : END 20 PRINT: CLS: PRINT "Oh GOODY! I love this game!" 21 pos=0: neg=0: Z=0 22 GOTO 1
yo yo as
The symbol √ for the square root was first used in print in 1525 inChristoph Rudolff's Coss, which was also the first to use the then-new signs '+' and '-'
num%=9 CLS PRINT "The square of: "; num%; " = "; num%*num% END
how to print "square" using for loop
If you found a picture of it you could print it, otherwise you need to buy it from Noble Collection.
#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; }
BeginRead:aSet Sqt=pow(a,1/2)If (a
1 CLS 2 PRINT "Please to tell me the length of the side of the square." 3 INPUT S 4 PRINT 5 PRINT "The perimeter of the square is "; 4 * S 6 PRINT 7 PRINT "The area of the square is "; S ^ 2 8 PRINT 9 PRINT "That was truly a total blast. Would you like to play again ? 'Y' or 'N' ." 10 INPUT A$ 11 IF A$ = "Y" or A$ = "y" then PRINT "Goody! " : GOTO 2 12 IF A$ = "N" or A$ = "n" then PRINT "Well OK then. Goodbye": END 13 PRINT: PRINT "Please to type a 'Y' to play again, or a 'N' to quit for now." 14 GOTO 10
Design a flowchart that accepts a single value and print BSCS for true result and BSIM otherwise? Design a flowchart that accepts a single value and print BSCS for true result and BSIM otherwise?
PRINT SQR(9) ...output... 3 (Thus, giving you the square root of the number 9; I presume this what your question meant...?)
for i = 0 to 8 { print i, i^2, i^3 }
The number located on a Thomas Kinkade print signifies that the print is real. Each print is handwritten on. If it starts with S/N it is a standard number, and means there are many of the print available. An A/P stands for artist proof, and is sold by Showcase Dealers and Signature Dealers and only a certain number available.
An infinite number of pages are required to print an infinitely large prime number.
Left click and selcet propertys scroll for the crop format or edit option choose and proceed after be sure to save changes incase you need it for later