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
Alexxandr [17]
2 years ago
5

Write a program to print ( SQUARE ) of first 10 natural numbers using while wend loop.

Computers and Technology
1 answer:
Wewaii [24]2 years ago
5 0

The program that will print (SQUARE) of first 10 natural numbers using while  loop is given below.

<h3>What is the code that returns the above result?</h3>

The program that returns the above result is:

public class KboatNaturalNumbers

{

   public static void main(String args[]) {

       int n = 1;

       int sum = 0;

       while (n <= 10) {

           System.out.println(n);

           sum = sum + n;

           n = n + 1;

       }

       System.out.println("Sum = " + sum);

   }

}

<h3>What is a loop?</h3>

A loop is a set of instructions that are repeatedly carried out until a specific condition is met in computer programming.

In most cases, a given procedure, such as collecting data and changing it, is followed by a condition check, such as determining whether a counter has hit a predetermined number.

Learn more about loops:
brainly.com/question/26568485
#SPJ1

You might be interested in
The _____ search algorithm searches a list for a given item, starting with the first element and continues to compare the item w
noname [10]

Answer:

Sequential

Explanation:

Based on the information provided within the question it can be said that the search algorithm that is being described in this scenario is a Sequential algorithm. This is because sequential programming focuses on programming (or in this case searching for) a result by doing one step at a time as opposed to various functions running simultaneously.

7 0
3 years ago
The BCD number for decimal 473 is( ). a) 111011010; b) 010011110011; c) 010001110011; d)0010110110​
jek_recluse [69]

Answer:

001101000111 is the bcd no for 347

8 0
3 years ago
4. What is the connection between productivity and Microsoft Office/ Office 365?
ikadub [295]
Microsoft 365 plans for home and personal include the robust Office desktop apps that you're familiar with, like Word, PowerPoint, and Excel. ... Office 2019 is sold as a one-time purchase, which means you pay a single, up-front cost to get Office apps for one computer.

Hope this helps :)
3 0
3 years ago
What refrigerant has been approved for new household refrigerators and freezers
Alexxx [7]
Bsbsnsnsnsn jajwjemoeododhdhdw whajsjshtzzvsssnxbba. 3
8 0
4 years ago
Define a method printFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand. End with a n
worty [1.4K]

Answer:

The program to this question as follows:

Program:

//header file

#include <iostream> //defining header file

using namespace std;

void printFeetInchShort(int numFeet,int numInches); //decalring method printFeetInchShort  

void printFeetInchShort(int numFeet,int numInches)//defining method printFeetInchShort

{

cout<<"height: "; // print message

cout<<numFeet<<"\'"<<""<<numInches<<"\""; //print value

}

int main() //defining main method

{

int numFeet, numInches; //defining integer variable

cout<<"Enter height feet: "; //print message

cin>>numFeet; //input value by user

cout<<"Enter height inches: "; //print message

cin>>numInches; //input value by user

printFeetInchShort(numFeet,numInches); //calling method printFeetInchShort    

return 0;

}

Output:

Enter height feet: 5

Enter height inches: 9

height: 5'9"

Explanation:

In the above C++ language program, first, a header file is included, that uses the basic function, in the next step, the "printFeetInchShort()" method is defined, in the method two integer variables passed as a parameter, inside this method a print function "cout" is used, that print user input value with single and double quote.

Then the main method is declared, inside this method two integer variables "numFeet and numInches" are defined, which is used to take input value by user and pass the value in "printFeetInchShort()" function parameter and call the function.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Jason is creating a web page for his school's basketball team. He just finished creating his storyboard. Which tool should he us
    7·1 answer
  • Which of the following information security technology is used for avoiding browser-based hacking?
    11·2 answers
  • To save the changes to the layout of a table, click the Save button on the _____.
    13·1 answer
  • Technician A says that a ratio is a comparison between two values. Technician B says that in a compression ratio, the main value
    5·1 answer
  • When working in the middle of a presentation, how do you preview the slide show from the current slide?
    12·1 answer
  • Software referd to the physical parts of the computer True or False
    9·2 answers
  • Jill is setting up a presentation and wants to use a built-in equation, such as the area of a triangle. To insert this in her pr
    14·2 answers
  • Write a program that prints the numbers 1 to 4 on the sameline with each pair of adjacent numbers separated by a single space(1
    5·1 answer
  • Write a method that returns a version of the given array where all the 10's have been removed. The remaining elements should shi
    9·1 answer
  • You can use this keyboard shortcut to toggle the visibility of the command line. If for some reason your command line is hidden
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!