C Program To Find Sum of All Odd Numbers Between Range, using While loop
Satish B
Lets write a C program to find sum of all odd numbers between range or between 2 integers input by the user.
Odd Number: An odd number is an integer that is not exactly divisible by 2.
For Example: 13 % 2 != 0. When we divide 13 by 2, it does not give a reminder of 0. So number 13 is an odd 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. i.e., start < end
If user enters start = 10 and end = 20. C program finds all the odd numbers between 10 and 20, including 10 and 20. So the odd numbers are 11, 13, 15, 17, 19. We add all these odd numbers and output the sum to the console window. i.e., 11 + 13 + 15 + 17 + 19 = 75. We out put the value 75 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=B_jGvvCh7Ho
4058915 Bytes