Array 1


#include<iostream.h>
#include<conio.h>
#include<iomanip.h>

int main()
{
const int MAXCNT = 10; // Constant
float arr[MAXCNT], x; // array, temp.variable
int i,cnt; // Index, quantity
cout<<"Enter up to 10 numbers \n"
<<"(Quit with a letter) :" <<endl;
for(i=0; i<MAXCNT && cin>> x; ++i)
arr[i] = x;
cnt = i;
cout <<"The given numbers : \n"<<endl;
for(i=0; i<cnt;++i)
cout<<setw(10) << arr[i];
cout<<endl;
getch();
return 0;
}

Comments

Popular posts from this blog

Animasi Lucu C++

Sistem Sensor dan Robotika

DDL Part II