Programming in C
Programming in C
4th Edition
ISBN: 9780321776419
Author: Stephen G. Kochan
Publisher: Addison-Wesley
Expert Solution & Answer
Book Icon
Chapter 4, Problem 2E

Explanation of Solution

Program:

The following program will display the values of n and n^2:

//include the header file

#include <stdio.h>

//definition of main method

int main (void)

{

//declare and initialize value to the variables

int n, n1 = 0;

//display the statements

printf ("The n and n^2 table is given below\n");

printf (" n     |    n^2\n");

printf ("-----------------\n");

//check the condition

for (n = 1; n <=10; ++n)

{

//calculate the "n1" v...

Blurred answer
Students have asked these similar questions
Write a program to read and store four student’s name and their CGPA, sort them into an order name, based on CGPA from the smallest to the largest, then print them out. The student’s name and their CGPA values should be typed in by the user in response to a prompt message.
(Print a table) Write a program that displays the following table:a     a^2      a^3      a^41       1         1           12       4         8           163       9         27         814      16        64        256
C++ Write a program to print a table for a number the number taken from user. The user entered number must be integer
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage