Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.65 KB | None | 0 0
  1. {
  2.             num1=0;
  3.             num2=0;
  4.             scanf("%c",&scanForEnter);
  5.                 scanf("%c",&ch1);
  6.                 while((ch1!=' ')&&(ch1!='\n'))
  7.                 {
  8.                     if((ch1>='0')&&(ch1<='9'))
  9.                     {
  10.                     digit=ch1-48;
  11.                     num1=num1*10+digit;
  12.                     }
  13.                     else if(ch1!='\n')
  14.                         printf("ERROR");
  15.                     scanf("%c",&ch1);
  16.                 }
  17.                 scanf("%c",&ch1);
  18.                 while((ch1!=' ')&&(ch1!='\n'))
  19.                 {
  20.                     if((ch1>='0')&&(ch1<='9'))
  21.                     {
  22.                     digit=ch1-48;
  23.                     num2=num2*10+digit;
  24.                     }
  25.                     else if(ch1!='\n')
  26.                         printf("ERROR");
  27.                     scanf("%c",&ch1);
  28.                 }
  29.                 printf("%d",num2/num1);
  30.                 if(num2%num1!=0)
  31.                 {
  32.                     printf("\n");
  33.                     printf("%d",num2%num1);
  34.                 }
  35.                 break;
  36.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement