heres the problem: write a program that will print the odd positioned elements in an array of 10 integers?
Help:in solving this program prob in using microsoft visual basic (c++)?
In C++, Here it is:
#include%26lt;iostream.h%26gt;
#include%26lt;conio.h%26gt;
void main()
{
int a[10];
clrscr();
cout%26lt;%26lt;"\n Enter 10 elements of array : ";
for(int i=0;i%26lt;10;i++)
{
cin%26gt;%26gt;a[i];
}
cout%26lt;%26lt;"\n The odd positioned elements of array are : ";
for(i=0;i%26lt;10;i++)
{
if(i%2)
cout%26lt;%26lt;a[i];
}
getch();
}
If this is want,
just say it : OM NAMAH SHIVAY
Reply:Gurudev solution is correct. I run it , its working.
He answers only if it is correct.
Check his record , he is simply best.
daisy
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment