Advertisement
mominulkarim77

১ থেকে ৫ পর্যন্ত সংখাগুলোর যোগফল। প্রিন্টঃ 1+2+3+4+5=15

Mar 7th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     int i,sum=0;
  5.     for (i=1;i<=5;i++) {
  6.             sum=sum+i;
  7.             if (i==5) {
  8.             printf("%d",i);
  9.             }
  10.             else {
  11.             printf("%d+",i);
  12.             }
  13.     }
  14.     printf("=%d\n",sum);
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement