Hi! I have some problems with a program that I tryed to make this morning.It has to make an array of up to 25 elements, show the elements on screen, write the even numbers in a new array and show it on screen too.I know it's a simple program but I really can't figure out where my my mistake is...
#include<iostream.h>
#include<stdlib.h>
constint N=25;
void main()
{
int k; //number of elements in the massiv
int p[N];
int br=0; //number of even numbers
int c[N]; //massiv of even numbers
int m=0;
cout<<"Vyvedete razmernost"<<endl;
cin>>k;
for(int i=0;i<k;i++)
{
cout<<"Vyvedete el.No "<<i+1<<endl;
cin>>p[i];
}
for(i;i<k;i++)
{
cout<<"El No "<<i+1<<"e "<<p[i]<<endl;
}
for(i;i<k;i++)
{
if((p[i]%2)!=0)
{ c[m]=p[i];
br++;
m++;
};
}
cout<<"Nechetnite chisla sa: "<<endl;
for(i;i<br;i++)
{
cout<<c[i]<<",";
}
exit(1);
}