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; }
Comments
Leave a comment