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
If the given number has two factors, one of them is 1.
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.
Yes.
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
It varies with each given number.
if ( x % 6 == 0 ){ printf( "%d is divisible by 6", x ); } else { printf( "%d is not divisible by 6", x ); }
distinct factors
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.
#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
OOPS stands for object oriented programming in short . Characteristics of OOPs are : encapsulation, data hiding, polymorphism etc.
You multiply the factors together. if the factors are 6 and 7 or 2,3 and 7, then the number is 6x7=2x3x7=42
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.