C++ code to Get an integer n from the user and print true if the given integer n is a triangular number

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter2: Using Data
Section: Chapter Questions
Problem 4E: In this chapter, you learned that although a double and a decimal both hold floating-point numbers,...
icon
Related questions
Question

The ancient Greeks classify numbers geometrically. For example, a number was called “triangular”
if that number of pebbles could be arranged in a symmetric triangle. The first ten triangular numbers
are 0, 1, 3, 6, 10, 15, 21, 28, 36, and 45.
Write a C++ code to Get an integer n from the user and print true if the given integer n is a triangular number, and
false otherwise. User can enter any integer as input.

 

FOR LOOP, NESTED LOOPS, BREAK STATEMENT, ARRAYS ARE NOT ALLOWED.

USE WHILE LOOP, IF ELSE.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Datatypes
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,