0

How do l print array of numbers in C++

C++

25th Jul 2022, 4:07 PM
GODFRED TAWIAH
GODFRED TAWIAH - avatar
7 Answers
+ 4
#include<iostream> using namespace std; int main(){ int arr[5]={0,1,2,3,4}; for(int index=0;index<5;index++) { cout<<arr[index]; } return 0; }
25th Jul 2022, 4:45 PM
Mihir Lalwani
Mihir Lalwani - avatar
+ 3
Manav Roy oh yeah...😅
25th Jul 2022, 4:48 PM
Mihir Lalwani
Mihir Lalwani - avatar
+ 2
#include <iostream> int main(){ int a[]={7, 6, 8}; for (int i:a){ std::cout<<i<<std::endl; } return 0; }
25th Jul 2022, 11:38 PM
Ujjawal Gupta
Ujjawal Gupta - avatar
+ 2
Manav Roy or by learning how to google 😂
25th Jul 2022, 11:39 PM
Ujjawal Gupta
Ujjawal Gupta - avatar