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

What else can I help you with?

Related Questions

Write a java program using forloop to generate the first 10 multiples of the first 10 natural numbers?

Here's a simple Java program that uses a for loop to generate the first 10 multiples of the first 10 natural numbers: public class Multiples { public static void main(String[] args) { for (int i = 1; i <= 10; i++) { System.out.print("Multiples of " + i + ": "); for (int j = 1; j <= 10; j++) { System.out.print(i * j + " "); } System.out.println(); } } } This program iterates through the first 10 natural numbers and prints their multiples from 1 to 10.


Write a program to generate the first 50 perfect numbers?

I don't believe that 50 perfect numbers have ever been found, last time I checked there were only about 47 known perfect numbers. It would also require an extremely powerful computer.


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.


How do you write a C plus plus program that will display the first 10 positive prime numbers?

By learning how to program on C+.


To generate first 10 Armstrong numbers?

which r the first 10 amstrong numbers??


Write a program to compute the sum of first ten integer numbers in PHP?

$n = 10*(1+10)/2;


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 }


Write a program to print first 100 alternative prime numbers?

This would require some computer knowledge. It can make it easier to find out the prime numbers without figuring it out in your head.


How do you write socket program in c?

For first find an example program.


Write a program to calculate first?

int first= 1;


How do you write numbers from first to fifty first?

with a pencil