Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int x,y;
  5. printf("enter the two number:");
  6. scanf("%d%d",&x,&y);
  7. if(y> 0)
  8. {
  9. while(y!=0)
  10. {
  11. x++;
  12. y--;
  13.  
  14. }
  15.  
  16.  
  17.  
  18.  
  19. }
  20.  
  21.  
  22. else if(y< 0)
  23. {
  24. while(y!=0)
  25. {
  26. x--;
  27. y++;
  28. }
  29.  
  30.  
  31.  
  32. }
  33.  
  34.  
  35. printf("sum of value is %d",x);
  36.  
  37.  
  38.  
  39.  
  40.  
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement