#include <stdio.h> #include <stdlib.h> int main () { int i , num , oddsum=0 , evensum=0 ; printf("Enter Integer Number :\n"); scanf("%d",&num); for (i=0;i<=num;i++){ if (i%2 == 0) { evensum=evensum+i; } else { oddsum=oddsum+i; } } printf("Sum Of All Odd Number is %d\nSum Of All Even Number is %d\n",oddsum,evensum); return 0; }
Most Popular
-
Befunge: Developed by : Chris Pressey Year: 1993 Stack-based, reflective, esoteric programming language.
-
-
The list below is an unordered list. You can pick any book you like, and some of the books don’t even cover a programming language at all,...
-
Recursion happens when function calls itself directly or indirectly.
Copyrights © 2016 Codzya. Powered by Blogger.
Monday, May 2, 2016
Subscribe to:
Post Comments (Atom)
Recent
Weekly
-
Befunge: Developed by : Chris Pressey Year: 1993 Stack-based, reflective, esoteric programming language.
-
-
The list below is an unordered list. You can pick any book you like, and some of the books don’t even cover a programming language at all,...
-
Recursion happens when function calls itself directly or indirectly.
-
1- The C Programming Language This book is a comprehensive guide to the finalized ANSI standard C language programming. It has b...
Comment
Get this Recent Comments Widget
!->
0 Comment to "Sum Of Odd and Even Numbers From 1 to N"
Post a Comment