Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- num1=0;
- num2=0;
- scanf("%c",&scanForEnter);
- scanf("%c",&ch1);
- while((ch1!=' ')&&(ch1!='\n'))
- {
- if((ch1>='0')&&(ch1<='9'))
- {
- digit=ch1-48;
- num1=num1*10+digit;
- }
- else if(ch1!='\n')
- printf("ERROR");
- scanf("%c",&ch1);
- }
- scanf("%c",&ch1);
- while((ch1!=' ')&&(ch1!='\n'))
- {
- if((ch1>='0')&&(ch1<='9'))
- {
- digit=ch1-48;
- num2=num2*10+digit;
- }
- else if(ch1!='\n')
- printf("ERROR");
- scanf("%c",&ch1);
- }
- printf("%d",num2/num1);
- if(num2%num1!=0)
- {
- printf("\n");
- printf("%d",num2%num1);
- }
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement