I wrote a small program to check if my number is a prime number or not. I think the code works fine, but I want the code to give me a single output: if it's a prime number or not.
I tried to find it on Google, but can't find an answer.
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
int main()
{
int z1,z_eingabe;
bool b1=true;
while(1){
printf("Zahl : ");
scanf("%d",&z_eingabe);
for(z1=2;z1<z_eingabe;z1++){
if(z_eingabe%z1==0){
printf("False %d\n",z1);
b1=false;
break;
}
if(b1==true){
if(z_eingabe%z1!=0){
printf("True\n");
break;
}
}
}
}
return 0;
}