Untitled


SUBMITTED BY: kaiser722

DATE: Oct. 7, 2016, 4:26 p.m.

FORMAT: Text only

SIZE: 494 Bytes

HITS: 8096

  1. C++ Language
  2. It converts the weight to ounce.
  3. #include<stdio.h>
  4. main( )
  5. {
  6. int pounds;
  7. /* Read first weight in pounds */
  8. printf("\n\n\tWeight in pounds?");
  9. scant("%d",&pounds);
  10. /* Loop until user signals halt with negatie integer. */
  11. while(pounds>=0)
  12. {
  13. printf("\n\n\tEquivalent weight in ounces: %d", pounds * 16);
  14. printf("\n\n\tWeight in pounds?");
  15. printf("\n\n\tEnter a negative integer to quit.");
  16. scanf("%d",&pounds);
  17. }
  18. }

comments powered by Disqus