Programming in C
Programming in C
4th Edition
ISBN: 9780321776419
Author: Stephen G. Kochan
Publisher: Addison-Wesley
bartleby

Videos

Textbook Question
Book Icon
Chapter 4, Problem 3E

A triangular number can also be generated by the formula

t

for any integer value of n. For example, the 10th triangular number, 55, can be generated by substituting 10 as the value for n in the preceding formula. Write a program that generates a table of triangular numbers using the preceding formula. Have the program generate every fifth triangular number between 5 and 50 (that is. 5, 10, 15,…, 50).

Blurred answer
Students have asked these similar questions
The equation of a straight line is written as y = mx + b where m is the slope of the line and b is the value of y when x = 0. If there are two coordinate points of the line are given, then it is very easy to compute the line equation. Also you can find the distance between two points. Problem: Write a program to compute lines equation for a set of lines. The number of lines is read from the user. Each line is computed by generating two points randomly using Point2D API. In addition, distance between two points is computed. The program should display a table which include all information about each line. See sample runs below. Take into consideration: 1. Number of generated lines should be greater than zero. 2. Two point objects are constructed only once. Then just update the location of two points for each line using Point2D API methods. 3. x and y values of each point are generated randomly to be less than 100 and greater than 0. 4. Compute the distance between two points using…
Write a program that picks four cards from a deck of 52 cards and computes their sum. An ace, king, queen, and jack represent 1, 13, 12, and 11, respectively. Your program should display the number of picks that yieldthe sum of 24.
An emirp ( prime spelled backward) is a nonpalindromic prime numberwhose reversal is also a prime. For example, both 17 and 71 are prime numbers, so 17 and 71 are emirps. Write a program that displays the first 100 emirps. Display 10 numbers per line and align the numbers properly, as follows:  13     17    31      37    71    73     79     97    107    113 149  157   167   179  199   311   337   347   359     389...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Java random numbers; Author: Bro code;https://www.youtube.com/watch?v=VMZLPl16P5c;License: Standard YouTube License, CC-BY