Array is a set of values in which we can store multiple values and access them one by one. When we initialize array it contain the garbage values and here in this problem we will remove these garbage values and initialize these values with zero.
Source Code
#include<iostream> using namespace std; int main () { int nums[5]; cout<<"\t \t \t LEP Tutorials \n \n \n "; cout<<"1. Numbers Without Initialization \n "; for (int i =0;i<5;i++) { cout<<endl; cout<<"\t"<<nums[i]; } cout<<endl<<endl; cout<<"2. Numbers After Initialization \n "; for (int i =0;i<5;i++) { nums[i] = 0; cout<<endl; cout<<"\t"<<nums[i]; } }
0 comments:
Post a Comment