answersLogoWhite

0


Best Answer

#include

void main ()

{


int i = 0; // This is initialising variables.

int n = 0;

int n2 = 0;


printf("n\t\tn^2\t\t\n______________________________\n"); // This creates the top line of the table, the "____" creates a line, the \t tabs across to create the headers making the heading look neater and more presentable.


for (i=0; i<=10; i=(i+1)) //setting conditions for loop

{


n2 = (i*i); // This is creating the second variable n2.


printf("%d\t\t%d\t\t\n", i, n2); // assigning variables n and n2 to rows.

}


system("pause"); // Pausing the program so I can view it in the execution window.

}



That should be it but correct me if im wrong.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a C program to generate and display a table of n and n2 for integer values of n ranging from 1 through 10?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a java application that generates two random numbers using built in method math random ranging 5 to 8 the program should use another built in method to calculate the power of xy the x value is t?

write a java application that generate custemer account balance in a banking system?


What products are offered by the Display Design company?

Display Design offers many different styles of banner displays for advertising purposes. Ranging a number of various sizes to capture the graphic that they design for you, in order to meet your advertising needs.


Why do scientists continue to study the Moon long after the Apollo program ended and list some of the types of data that have been collected.?

One type of data currently collected as a direct result of the Apollo Program is the Lunar Laser Ranging Experiment. The ongoing Lunar Laser Ranging Experiment measures the distance between the Earth and the Moon using laser ranging. Lasers on Earth are aimed at retroreflectors planted on the Moon during the Apollo program (11, 14, and 15), and the time for the reflected light to return is determined.


Why do scientist continue to study the moon long after the Apollo program ended and list some of the types of data that have been collected?

One type of data currently collected as a direct result of the Apollo Program is the Lunar Laser Ranging Experiment. The ongoing Lunar Laser Ranging Experiment measures the distance between the Earth and the Moon using laser ranging. Lasers on Earth are aimed at retroreflectors planted on the Moon during the Apollo program (11, 14, and 15), and the time for the reflected light to return is determined.


Who offers a really great weight training program?

Gilad Janklowic's Bodies In Motion is a wide-ranging series of exercise DVDs and includes a weight training program for beginners. Go to his website, bodiesinmotionwithgilad.com to purchase.


Why was a mirror put on the moon?

The ongoing Lunar Laser Ranging Experiment measures the distance between the Earth and the Moon using laser ranging. Lasers on Earth are aimed at retroreflectors planted on the Moon during the Apollo program, and the time for the reflected light to return is determined.


What was the name of the mission that study the Planet Venus in 2007?

You likely mean NASA's MErcury Surface, Space ENvironment, GEochemistry, and Ranging (MESSENGER) program of 2007.


What is a Leupold rangefinder used for?

A 'Leupold rangefinder' is used for mainly golfing, in which it can provide you with a range of features, amongst them are things such as extremely accurate ranging measurements and high-tech programming all with a luxurious display.


What is the full form of APOLLO?

1) Apache Point Observatory Lunar Laser-ranging Operation (NASA) 2) America's Program for Orbital and Lunar Landing Operations


Is south university an accredited online program?

Yes the South University is an accredited online program that has been established since 1899. It offers not only a variety of different degrees, ranging from Health Science to Nursing but also in Bachelors or Master's form.


What does the letter s stand for in sonar?

Sonar stands for Sound Navigation And Ranging.


Is sunset shimmer a tomboy?

Sunset Shimmer is typically depicted as a confident and outgoing individual, with interests ranging from fashion to academics. While she may display tomboyish traits at times, she is not strictly defined as a typical tomboy character.