answersLogoWhite

0

echo enter a range

read rng

echo 2

j=3

while test $j -le $rng

do

i=2

x=`expr $j - 1`

while test $i -le $x

do

if [ `expr $j % $i` -ne 0 ]

then

i=`expr $i + 1`

else

break

fi

done

if [ $i -eq $j ]

then

echo $j

fi

j=`expr $j + 1`

done

User Avatar

Wiki User

13y ago

Still curious? Ask our experts.

Chat with our AI personalities

DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran
SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve

Add your answer:

Earn +20 pts
Q: Write a shell program to generate the first 25 prime numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Write a java script program to print first ten odd natural numbers in C?

Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.


To generate first 10 Armstrong numbers?

which r the first 10 amstrong numbers??


How do you write a program to find out the square and cube of first ten natural numbers in gw basic?

First you will need to have some basic programming knowledge. You can use this to help make the program that is needed.


How do you write a c program to generate first n natural numbers using a for loop?

#include<stdio.h> main(void) { int n; int i; printf("Type n: "); scanf("%d",&n); for(i=1;i<=n;i++) //generates natural numbers from 1,....,n. printf("%d\n",i); //prints these numbers to standard output }


Program in 'c' to find the LCM of any given five numbers?

Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.