SHARE
TWEET

problem 1 loop

rony-Rony_05 Jun 19th, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int sum=0,i=2,num;
  5. scanf("%d",&num);
  6. while(i<=num)
  7. {
  8. sum=sum+i;
  9. i=i+2;
  10. }
  11. printf("even sum=%d",sum);
  12. return 0;
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top