Advertisement
QUIZERA

SUM OF NATURAL NUMBERS

Feb 8th, 2019
3,606
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. int main(){
  3. int number,answer=0;
  4. printf("enter a number ");
  5. scanf("%d",&number);
  6. for (; 0<number; number--)
  7. {
  8.     answer=number+answer;
  9.  
  10. }
  11. printf("answer,%d",answer );
  12.  
  13. return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement