Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок0
How to print composite numbers that are consecutive
For example, 24 ,25 ,26 ,27 and 28 are all composite numbers and also consecutive
1 ответ
+ 1
The answer:
for(i=1;i<=n;i++){
for(j=i;j<=i+5;j++){
c=ob.compcheck(j); \\Use function compcheck() to check for composite no.
if (c==1) \\ 1 means composite no.
k++; }
if (k>=2)
on.disp(i ,k); \\ Use function disp() to display that follow the no.
}
That's all!!!