C++ program using class – To multiply by 10 to every member of a list

by Nideesh C on April 14, 2011 · 2 comments

in C++




#include<iostream.h>
#include<conio.h>
class array
{
 public: void readarray();
         void multiply();
};
void array::readarray()
{
	int a[10];
	cout<<"Enter the elements of the Array"<<endl;
	for(int i=0;i<=9;i++)
	  cin>>a[i];
}
void array::multiply()
{
	int i,j,a[10],temp[10];
	for(i=0;i<=9;i++)
	{
		for(j=0;j<=9;j++)
		temp[i]=(a[i]*10);
	}
	cout<<"Result are as follows"<<endl;
	for(j=0;j<=9;j++)
		cout<<temp[j]<<endl;
}
void main()
{
	array mul;
	clrscr();
	mul.readarray();
	mul.multiply();
	getch();
}



Not Satisfied ? Just search & get the result

Related Posts Plugin for WordPress, Blogger...
Be Sociable, Share!

Related posts:

  1. C++ program to implement Insertion sort using class
  2. C++ program to implement Selection sort using class
  3. C++ program to implement Quick sort Algorithm using class
  4. C++ program to multiply two polynomials maintained as linked lists
  5. C++ class program – perform rational number arithmetic

{ 2 comments… read them below or add one }

1 Anonymous May 20, 2011 at 9:49 am

C++ program using class – To multiply by 10 to every member of a list is good article

Reply

2 Neema Khan June 17, 2011 at 8:13 pm

dear brother, your c programming articles very useful to me.. thanks a lot

Reply

Leave a Comment

Previous post:

Next post: