current position:Home>The sum of a positive integer and 3 is a multiple of 5, and the difference between a positive integer and 3 is a multiple of 6. Write a program to find the minimum number that meets the conditions.

The sum of a positive integer and 3 is a multiple of 5, and the difference between a positive integer and 3 is a multiple of 6. Write a program to find the minimum number that meets the conditions.

2022-02-03 01:05:01 CSDN Q & A

A positive integer and 3 And is 5 Multiple , And 3 The difference is 6 Multiple , Write a program to find the minimum number that meets the conditions .




Refer to the answer 1:
#include <stdio.h>int main(){   int n = 1;   while(1){       if((n + 3) % 5 == 0 && (n - 3) % 6 == 0){           printf("%d",n);           break;       }       n ++;   }   return 0;}



Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202030105001139.html

Random recommended