Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int a , b ;
- char z ,tmp[10];
- printf("Program checks divisibility a through b\n");
- printf("Enter a pair of integer numbers");
- do{
- {
- printf("enter a =");
- scanf("%s",&tmp);
- }
- while(atoi(tmp)==0);
- a = atoi(tmp);
- do
- {
- printf("enter b =");
- scanf("%s",&tmp);
- }
- while(atoi(tmp)==0);
- b = atoi(tmp);
- if((a%b) == 0) printf(" Number a = %d is divisible through b = %d",a,b);
- else printf(" Number a = %d is not divisible through b = %d",a,b);
- printf("\nContinoe? (n-finish)\n");
- z = getchar();
- }while((z!='n')&&(z!='N'));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement