We've moved! — MindVault360 is now SrcForge. Better design, more content & premium notes.

Visit SrcForge →

MindVault360 has moved!

We've upgraded to SrcForge — a faster, more professional platform with better content, premium notes, and a modern design.

Visit us at SrcForge

Wednesday, September 18, 2024

Arrays in CPP

 Arrays

 An array is a group of related data items that share a common name

 To Use Arrays

            Declare a variable

       Store the values

       access the values

 

Example 01:

# include <iostream.h>

void main()

{

            int a[10]; //declaration

            for (int i=0;i<10;i++) //storing the values

             cin>>a[i];

 

            for (int i=0;i<10;i++) // printing the values

             cout<<a[i];

}

← Back Next →

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home