C Program To Find Sum of All Even Numbers Between Range, using While loop
Satish B
Lets write a C program to find sum of all the even numbers between range or between 2 integers input by the user.
Even Number: An even number is an integer that is exactly divisible by 2.
For Example: 10 % 2 == 0. When we divide 10 by 2, it give a reminder of 0. So number 10 is an even number.
Note: In this C program we ask the user to input start and end value. We assume that the user enters bigger value for variable end and smaller value for variable start.
If user enters start = 10 and end = 20. C program finds all the even numbers between 10 and 20, including 10 and 20. So the even numbers are 10, 12, 14, 16, 18, 20. We add all these even numbers and output the sum to the console window. i.e., 10 + 12 + 14 + 16 + 18 + 20 = 90. We out put the value 90 as result.
C Programming Interview / Viva Q&A List http://technotip.com/6378/c-programming-interview-viva-qa-list/
C Programming: Beginner To Advance To Expert http://technotip.com/6086/c-programming-beginner-to-advance-to-expert/ ... https://www.youtube.com/watch?v=QX3DExBMohQ
3967395 Bytes