Write a simple program with array, loop and if-else (all together in one program) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Write a simple program with array, loop and if-else (all together in one program)

please help, need it asap :( THANK YOU SO MUCH!

5th Oct 2016, 2:12 PM
Student in Need
Student in Need - avatar
2 Answers
0
#include <iostream> using namespace std; int main(){ int arrayint = [50, 28, 63]; for(int j = 0; j < 3; j ++){ cout<<arrayint[ j ]; } if(2 == 3){ cout<<arrayint[0]; }else{ cout<<arrayint[2]; }
5th Oct 2016, 5:46 PM
Vatsalya
0
int main() { int array[5], i, n; cout<<"enter no of input <5"; cin>>n; if(n<=4) { for(i=0;i<=4;i++) { cin>>array[i] ; } for(i=0;i<=4;i++) { cout<<array[i] ; } } else { cout<<" too many input"; } }
6th Oct 2016, 5:12 AM
Kumud Nakarmi
Kumud Nakarmi - avatar