yousuf839

Summation of series

Feb 16th, 2023
91
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | Software | 0 0
  1. /*
  2. * Author Name: M.A. Yousuf Sir
  3. * Call: +880 191 55 84 839 (8.00 am to 10.00 pm GMT+6 )
  4. * Summation Of Series: 1+3+5+.......+30
  5. */
  6. #include<stdio.h>
  7. #include<conio.h>
  8. main(){
  9.  int a,s;
  10. a=1;
  11. s=0;
  12. while(a<=30){
  13. s = s+a;
  14. a+=2;
  15. }
  16. printf("sum=%d",s);
  17. }
Advertisement
Comments
  • yousuf839
    3 years
    # C 0.27 KB | 0 0
    1. /*
    2. * Author Name: M.A. Yousuf Sir
    3. * Call: +880 191 55 84 839 (8.00 am to 10.00 pm GMT+6 )
    4. * Summation Of Series: 1+3+5+.......+30
    5. */
    6. #include<stdio.h>
    7. #include<conio.h>
    8. main(){
    9.  int a,s;
    10. a=1;
    11. s=0;
    12. while(a<=30){
    13. s = s+a;
    14. a+=2;
    15. }
    16. printf("sum=%d",s);
    17. getch();
    18. }
Add Comment
Please, Sign In to add comment