Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
C++
calculate sum in c++
Hồ Quang Trung
Programming language:
C++
2021-05-20 23:28:53
0
Q:
calculate sum in c++
Starcatcher7
Code:
C++
2021-03-31 06:42:57
for (sum = 0; n > 0; sum += n % 10, n /= 10); //single line statement //where n=the imput number
3
Tags
sum
Related
sum of stack c++
c++ program for addition of two numbers using functions
how to calculate inverse trigonometric values in c++
sum of 2 numbers in cpp function
subarray sum in c++
two sum problem in c++
sum of two numbers c++
c++ program to calculate the value of pi
c++ sum of all numbers up to a number
c++ function to find minimum element in array
sum of integer in array c++
maximum subarray sum in c++
c++ code for polynomial addition
how to calculate trigonometric values in c++
sum of vector c++
sum of 2 numbers in cpp
c++ sum up numbers
New to Communities?
Join the community