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
In Java Write a program that prints the 128-character ASCII table. It should print the tablein eight tab-separated columns. The first column contains a "Dec" heading (fordecimal number) with the numbers 0 through 31 below it. The second columncontains the ASCII characters associated with the numbers 0 through 31. The nextcolumns contain the subsequent numbers and associated ASCII characters. See thebelow sample output for details. Be aware that that output was produced by aprogram running in a console window in a Windows environment. If you runyour program in a different environment, the first 32 characters and the lastcharacter will probably be different from what’s shown below.Note that some characters display in a non-standard manner. For example, thenumber 7 corresponds to a bell sound. You can’t see a sound, but you can see thevacant spot for 7’s character in the below table. The number 8 corresponds to thebackspace character. You can’t see a backspace, but you can see how the…
Write a program that will create a twelve line times table from 8 to 19 based on user input. The table will have three columns centred correctly on the screen with proper column titles. All programs will have a title, introduction, correctly ask for user input and display the resultant design. Do not use any built-in math functions.
Complete the python code Find the mean, median, and mode of the column wt. Print the mean, median, and mode Ex: for the column qsec, the output would be: mean = 17.84875, median = 17.710, mode = 0    17.02 1    18.90 dtype: float64     import pandas as pd   df = pd.read_csv('mtcars.csv')   mean = # find the mean of the column wt median = # find the median of the column wt mode = #find the mode of the column wt   print("mean = {:.5f}, median = {:.3f}, mode = {}".format(mean, median, mode))
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning