Array

  #include <iostream>  
 using namespace std;  
 int main(void){  
   int n, i, comp = 0;  
   cin >> n;  
   int arr[n];  
   for (i = 0; i < n; i++)  
     cin >> arr[i];  
   // compairing for largest number  
   for (i = 0; i < n; i++) {  
     if (comp > arr[i])  
       cout << comp;  
     else   
       comp = arr[i];  
   }  
 }  

0 Comments

Brand creation, trend analysis & style consulting

Lorem Ipsum has been the industry's standard dummy text ever since. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since.