Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- main(){
- int sayi;
- int basla = 2;
- int asalmi;
- printf("Sayiyi giriniz : ");
- scanf("%d",&sayi);
- asalmi = 1;
- while(basla < sayi){
- if(sayi % basla == 0){
- asalmi = 0;
- }
- basla++;
- }
- if (asalmi == 1){
- printf("%d sayisi asaldir.",sayi);
- }else{
- printf("%d sayisi asal degildir.",sayi);
- }
- getchar();
- }
Advertisement
Add Comment
Please, Sign In to add comment