Comments
Pages
Home
Object Oriented Programming
Professor Don Knuth's
About us
Join This Site
Learn Unity3d AI Programming
Wednesday, October 17, 2012
Show Array in assending order
Posted by
MindBreaker
at 8:12 AM
Read our
previous post
Object
Write a function which takes an array of 10 elements and sort them in ascending order. Print sorted array from the
calling function.
Source code
#include
<iostream>
using
namespace
std;
int
factorial (
int
);
int
factorial (
int
num)
{
int
ans=1, fac;
for
(fac=1;fac<=num;fac++)
{
ans=ans*fac;
}
return
(ans);
}
void
main(
void
)
{
int
num , fact,fac;
cout<<
"Enter the number :"
;
cin>>num;
fact=factorial(num);
cout<<
"The factorial of number are:"
<<fact<<endl;
cout<<
"The number of Execution:"
<<num<<endl;
}
Output
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Popular Posts
OOP program to create 3 ship and their direction
Object Create a class called ship that incorporates a ship’s number and location. Use the approach of Exercise 8 to number each ship obj...
Bubble sort using pointers.
Object: Bubble sort using pointers. Source Code: #include <iostream> using namespace std; void bubble( int *, int...
OOP Take input in two object of class
Object In ocean navigation, locations are measured in degrees and minutes of latitude and longitude. Thus if you’re lying off the mou...
OPP use of enum
O bject: Extend the employee class of Exercise 4 to include a date class (see Exercise 5) and an etype enum (see Exercise 6 in Chapter...
Translate the linear search algorithm into a program which either find the location LOC where ITEM appears in ARRAY or return LOC=0.
Object: 3. Translate the linear search algorithm into a program which either find the location LOC where ITEM appears in ARRAY...
Translate binary search and insertion algorithm into a program which finds either the location LOC where ITEM appears in ARRAY or the location
Translate binary search and insertion algorithm into a program which finds either the location LOC where ITEM appears in ARRAY or the ...
OOP Add Num of two Object initailize in Constructor
Object Create a class that imitates part of the functionality of the basic data type int. Call the class Int (note different capitalizat...
OOP Fraction Addition
Object Transform the fraction structure from Exercise 8 in Chapter 4 into a fraction class. Member data is the fraction’s numerator ...
Delete numbers using binary search
Write a program which uses Binary Search to search the elements 45,and 78 and delete it. NUMBERS=[11,22,33,36,45,52,57,60,64,78] ...
Matrix multiplication algorithm
Translate the matrix multiplication algorithm into a program which finds the product C of an nxm matrix A and pxn matrix B. Test the...
Labels
add two matrix
array
arrays
average numbers in arrays
average values
Binary Search
Bubble sort
Bubble sort in ascending order using pointers.assenting order
Bubble sort using pointers
c++
C++ programs.Codepirarte2012
Circular linklist
Code
Codepirate
CODEPIRATE2012
Codes
Codings
Convert celcius temperature into Frenhiet
day month year calculator
days
days month year convert
days month year convert using pointers and arrays
delete
delete from array
delete number from
Delete numbers using binary search
delete text from file
display
display text in file
Double headed link list
Double link list.link list
Even
even odd values in arrays
filling Add text in file
Find the 15 multiple of any number
Find the Bigger number of the 3
Find the Remainder quotient between two number
Find the Roots Quadratic of the equations
Find the smallest number in array
Find the Uppercase lower case in sentences
insert
insert values in arrays
linear search algorithm.find location in array
linklist
Lower case
MANAGEMENT
matrix
matrix multiplication algorithm
merge sort
Merge sort using arrays
month
multiple two matrix
odd
pointers
pop
product of sum
program
Programmings
programs.C++
PROJECT
push
return in array
Roots using array.quadratic roots
scalar values adding to matrix
search text i filling
smallest number
stack
sum of product
TAXI RESERVATION
Translate binary search and insertion algorithm into a program which finds either the location LOC where ITEM appears in ARRAY or the location
two dimension array
two number reminder
Uppercase
using array and pointers
using pointer
using pointers
values in array
values in arrays
Word in sentences
Write a program that count the Words in the sentence
year
© Codepirate is powered by
Blogger
-
Template designed by
Stramaxon - Best SEO Template
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.