1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
irakobra [83]
3 years ago
9

Write a program that uses an "if" statement to determine if the number is greater than one. If the number is greater than 1, the

program calculates the square and cube of the number and displays the output to the user.
Computers and Technology
1 answer:
Vsevolod [243]3 years ago
7 0

Answer:

if(i>1)

{

Console.WriteLine(i*i);

Console.WriteLine(i*i*i);

}

Explanation:

This is written in C#, and it's probably not as clean as it could be. I'm not sure what language you wanted it in, so I just picked the one I'm most familiar with.

You might be interested in
Subana is writing a program which will calculate the mean average of a set of numbers by adding the numbers and dividing the res
marysya [2.9K]

Answer:

Data Type: Double (decimal)

Variable Name: avg

Explanation:

An average of numbers will typically give you a decimal answer. Therefore, you should use the Double data type.

8 0
3 years ago
Read 2 more answers
Concept of national sovereignty was established by the
Eduardwww [97]

Answer:

Explanation:

Thomas Hobbes. He was the one who provided the term with its modern meaning.

7 0
4 years ago
Write a program that has a while loop to print out the first five multiples of 15, 43, and 273 between the numbers of 3168 and 3
Reika [66]

Answer:

#include <iostream>

using namespace std;

void printmultiples(int n) //function to print first five multiples between 3168 and 376020

{

   int a =3168,c=1;

   cout<<"First five multiples of "<<n<<" are : ";

   while(a%n!=0 && a<=376020) //finding first mutiple of n after 3168.

   {

       a++;

   }

   while(c<6)//printing multiples.

   {

       cout<<a<<" ";

       a+=n;

       c++;

   }

   cout<<endl;

}

int main() {

   int t,n;

   cin>>t;//How many times you want to check.

   while(t--)

   {

       cin>>n;

       printmultiples(n);//function call..

   }

return 0;

}

Input:-

3

15

43

273

Output:-

First five multiples of 15 are : 3180 3195 3210 3225 3240  

First five multiples of 43 are : 3182 3225 3268 3311 3354  

First five multiples of 273 are : 3276 3549 3822 4095 4368

Explanation:

I have used a function to find the first five multiples of the of the numbers.The program can find the first five multiples of any integer between 3168 and 376020.In the function I have used while loop.First while loop is to find the first multiple of the integer n passed as an argument in the function.Then the next loop prints the first five multiples by just adding n to the first multiple.

In the main function t is for the number of times you want to print the multiples.In our case it is 3 Then input the integers whose multiples you want to find.

7 0
4 years ago
1. The advancement of media and information bring society countless opportunities such<br>as...​
rjkz [21]

Answer:

The advancement of media and information bring society countless opportunities such as quick access to information that helps people during their daily lives and problems.

Thus, for example, nowadays the use of the internet and social networks allows individuals very fast access to different methods of solving everyday problems: a clear example is the tutorial videos where it is explained how to carry out a certain activity or arrangement of a break on a specific asset, providing users with a quick solution to their daily problems.

5 0
3 years ago
Ayoooo new friends? btw imma girl
liberstina [14]
Yup, me ... i wanna be friends
4 0
3 years ago
Read 2 more answers
Other questions:
  • How can I get a refund of my money back
    12·2 answers
  • Text, numbers,graphics, sounds entered into a computer's memory during input operations are referred to as
    11·1 answer
  • Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per l
    13·1 answer
  • Why would a person who handles electronic components wear a grounded wrist strap
    13·1 answer
  • What will Jason need to assemble a microcomputer and connect it to memory chips
    8·1 answer
  • marco wants to create a heading that is bold and italic to make it really stand out on his webpage. he's typed in the code
    12·2 answers
  • A copy machine is available 24 hours a day. On a typical day, the machine produces 100 jobs. Each job takes about 3 minutes on t
    8·1 answer
  • What is modularity? Help asap
    9·1 answer
  • 21
    5·1 answer
  • Which statement describes the Direction option for animations and transitions?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!