answersLogoWhite

0

echo "Enter a number: "

read num

i=2

res=1

if [ $num -ge 2 ]

then

while [ $i -le $num ]

do

res=`expr $res \* $i`

i=`expr $i + 1`

done

fi

echo "Factorial of $num = $res" v

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

One of two factors of a given number?

If the given number has two factors, one of them is 1.


How do you know a number if its factors are given?

There are two ways in which the factors can be given. You are given all the prime factors (and their multiplicity). In that case simply multiply them all together. Or You are given each factor. In this case, the biggest of these is the number.


Is the number of factors of a given number is limited?

Yes.


What is the difference between program and programming?

define program i. program means set of instruction which are required for a particular type of task is called program ii. set of instruction or commands which are given for the computer to do different activity or jobs or works is called program define programming the process of creating/modifying a program; some people's job, others' hobby


How many distinct strings of factors are there for a given number?

It varies with each given number.


How do you write a program to test if a given number is divisible by 6 in C programming?

if ( x % 6 == 0 ){ printf( "%d is divisible by 6", x ); } else { printf( "%d is not divisible by 6", x ); }


What is factors that appear in a complete list of factors for a given number only once?

distinct factors


Thw importance of ASP.net?

Object Oriented Programming is a subset of structured programming. After objects are created in a program, you use those objects and their methods to operate the program. In structured programming, you have a program with many methods in which you can use. One difference between structured programming and object-oriented programming is that structured programming uses the data that is given to them through parameters, while in object-oriented programming, the methods act upon the object's data (fields). This makes programming much easier because the fields are all there and you do not have to make sure that the correct field is passed to the correct method. All you have to do is call which field you want to work with.


Program in c language to find prime factors of a given number?

#include<stdio.h> #include<conio.h> void main() { int n,i; clrscr(); printf("Enter a Number:"); scanf("%d",&n); printf("\n\nPrime Factors of %d is: ",n); for(i=2;i<=n;i++) { if(n%i==0) { printf("%d,",i); n=n/i; i--; if(n==1) break; } } getche(); } this program will find the prime factors of a given numbe any assistance mail at :- devilllcreature@yahoo.com thank you


What is OOP concept?

OOPS stands for object oriented programming in short . Characteristics of OOPs are : encapsulation, data hiding, polymorphism etc.


How do you find the number of its given factors?

You multiply the factors together. if the factors are 6 and 7 or 2,3 and 7, then the number is 6x7=2x3x7=42


What is the difference between factors of a number and prime factors of a number?

All numbers have factors. Some factors are prime numbers. These are known as prime factors. The set of prime factors is a subset of the set of factors for any given number.