c program to find odd number
Program:-
Method 1
c program to find sum of odd number using for loop
Method 2
c program to find sum of odd number using while loop
Method 3
c program to find sum of odd number using do while loop
Output:-
Enter a number
5
sum of odd number 9
not understandable............
ReplyDeletedoesn't work :/
ReplyDeleteSorry to say, but the program is wrong. i is being incremented for both even and odd numbers. So actually the output should be 1+3+5+7+9 = 25. Because i increments for both even and odd numbers, you get the output as 9 (1+3+5=9)
ReplyDelete