Use programming c Problem 11 create a script to find all pri
Solution
Ans)
Problem1:--C-code here for C program to print 1 to 100 prime numbers
----------------------------
#include<stdio.h>
#include<conio.h>
int main(){
int i, j, isPrime;
printf(\"prime numbers between 1 to 100\ \");
for(i = 2; i <= 100; i++){
isPrime = 0;
/* Check whether i is prime or not */
for(j = 2; j <= i/2; j++){
/* Check If any number between 2 to i/2 divides I
completely If yes the i cannot be prime number */
if(i % j == 0){
isPrime = 1;
break;
}
}
if(isPrime==0 && 100!= 1)
printf(\"%d \",i);
}
getch();
return 0;
}
-------------------------------
Only 1 question per post will be answered please
