SQL beginners
174 subscribers
76 photos
2 videos
5 files
19 links
Download Telegram
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
int a,j=0,c;
cin>>a;
c=a-1;
while(c>1){
if(a%c==0){
break;
}
else{
j++;
c--;
}
}
if(j==a-2){
cout<<a<<" Tub son ekan";
}
else{
cout<<"Tub son emas";
}
} Tub son yoki yo'qligini aniqlash
/*TUB SONLAR N GACHA BO'LGAN*/
#include <iostream>

using namespace std;

int main()
{
int a=2,c,f=0,b;
cin>>b;
while(b>=a){
c=a-1;
while(c>1){
if(a%c==0){
f++;
break;
}
else{
c--;}
}
if(f==0){
cout<<a<<" ";
}
else{
f=0;
}
a++;

}
}
2💯2👀1