This is a C++ program that initializes an integer array arr with five elements and then outputs each element on a separate line. The program first initializes the array arr with the values {1, 3, 5, 7, 9} using an array initializer. It then outputs each element of the array on a separate line using a series of cout statements.
#include <iostream> using namespace std; int main() { int arr[] = {1, 3, 5, 7, 9}; cout<<arr[0]<<endl; cout<<arr[1]<<endl; cout<<arr[2]<<endl; cout<<arr[3]<<endl; cout<<arr[4]<<endl; return 0; }To download raw file Click Here
1 3 5 7 9
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions