How to write a simple C Program for calculating a sum of integers?
In C Programming using C++ Environment, I want to calculate the sum of some continuous integers, say 1 to 10. I have studies some loop structures like "while", "do-while" and "for" etc. While I can successfully get the required output using the "while" loop structure, I am not getting the desired output using the "for" loop structure.
The program code is attached as an image below. Can I get the desired output using the "for" loop or not? The output I am getting using the "for" loop is also attached.
Do you want to calculate sum of integers from 1 to 10 using for loop in c++? I have attached the code. Check it
by sudeepbanerjee7 years ago
write a c program to input the number and print the even number
by aparnatrivedi7 years ago
Write a C program to compute the average marks in a subject of all the students in a class.
Copyright © 2018 HubPages Inc. and respective owners.
Other product and company names shown may be trademarks of their respective owners.
HubPages® is a registered Service Mark of HubPages, Inc.
HubPages and Hubbers (authors) may earn revenue on this page based on affiliate relationships and advertisements with partners including Amazon, Google, and others.