Programming in C
Programming in C
4th Edition
ISBN: 9780321776419
Author: Stephen G. Kochan
Publisher: Addison-Wesley
Question
Book Icon
Chapter 7, Problem 2E
Program Plan Intro

Program Plan:

  • Include required header files
  • Give the function prototype
  • Define the main function
    • Declare the variable “number” and “counter” as “int”.
    • For loop to increment the value of counter.
      • Get the number from the user.
      • Call the function “calculateTriangularNumber ()”.
      • Return the value “0”.
  • Definition for the function “calculateTriangularNumber()”
    • Declare the variable “i” , “t” as “int”.
      • For loop to check the condition.
        • Add the value of “i” and store it in the variable “t”.
        • Return the value of “t”.

Blurred answer
Students have asked these similar questions
Show the work
show all the work
show all the work
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,