Program to display the prime numbers between 1 and 100 using Function

This page has a Program to display the prime numbers between 1 and 100 using Function. The Prime numbers are the whole numbers, and they have no divisors other than 1 and the testing numbers. For example: 79, 83, 89, 97 are Prime numbers. The below given C program is used to display the Prime numbers between 1 and 100 using function. Kindly check out the program to display the Prime numbers between 1 and 100 using function.

How eill ask to display the Prime numbers between 1 and 100 using Function

The questions to display the Prime numbers between 1 and 100 using Recursion can be asked as 1). C program to display all prime numbers between 1 and 100 using Function. 2). C program to display all prime numbers from 1 to 100 using Function. 3). C program to display the prime numbers within 1 and 100 using Function. 4). C program to display the list of prime numbers between 1 and 100 using Function.

Program to display the Prime numbers between 1 and 100 using function

#include<stdio.h>

void prime();

int main(){

printf(" Prime numbers between 1 and 100 using function . . .



");

prime();

getch();

return 0;

}



void prime(){

int numbr,k,remark;

for(numbr=2;numbr<=100;++numbr){

remark=0;

for(k=2;k<=numbr/2;k++){

if((numbr % k) == 0){

remark++;

break;

}

}

if(remark==0)

printf(" %d ",numbr);

}

}

Sample output:

Prime numbers between 1 and 100 using function . . .

2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97