Answer to Question #30897 in C++ for omer moiz

Question #30897
Write a Computer Program that takes 10 Characters From a User. Hold all the Characters in a Character Array, Ask the user the Point Where the Arrays divided, Make 2 sub-arrays from a Single Array and Count the Numbers of Elements in the Second Array.
1
Expert's answer
2013-05-23T08:30:34-0400
#include <iostream>#include <stdlib>
using namespace;
char array[10];
int number;
int main()
{
cout<<"Input 10 characters"<<endl;
for (inti=0;i<10;i++) cin>>char[i];
cout<<"Input number <10"<<endl;
cin>>>number;
chararray_new1(number), array_new2(10-number);
for (int i=0;i<number;i++){
array_new1[i]=array[i];
cout<<array_new1[i];
}
cout<<endl;
for (inti=number; i<10;i++){
array_new2[i]=array[i];
cout<<array_new2[i];
}
cout<<endl;
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS