Welcome To The World Of Hacking


Learn Hacking|Teach Hacking|Learn To Secure|Learn To Code

Friday

C++ TUTORIAL 13: INTRODUCTION TO ARRAY

#include<iostream>
using namespace std;

int main()
{
    int scores[10];
    int i=0;
    scores[0]=50;
    cout<<"scores[0] :"<<scores[0]<<endl;
    scores[i]=42;
    cout<<"scores[i] which is equivalent to scores[0] :"<<scores[i]<<endl;
    scores[5]=55;
    i=i+5;
    cout<<"scores[5] :"<<scores[5]<<endl;
    cout<<"scores[i] :"<<scores[i];
    return 0;
}

OUTPUT:

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...