Untitled

 avatar
unknown
plain_text
2 months ago
786 B
2
Indexable
#include <cstdlib>
#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{
    int i,shuma,n,max,min;
    cout<<"jep nje numer per gjatesine e vektorit"<<endl;
    cin>>n;
    
   int vektori[n];
   
   for(i=0;i<n;i++)
   {
       cout<<"jep elementin"<<(i+1)<<endl;
       cin>>vektori[i];
   }
   
   shuma=0;
   max=1;
   min=1;
 
   for(i = 0 ;i<6;i++)
   {
       shuma+=vektori[i];
       if(vektori[i]>max)
          max=vektori[i];
          
           if(vektori[i]>min)
          min=vektori[i];
   }
   cout<<"shuma totale e elementeve te vektorit eshte:"<<shuma<<endl;
   cout<<"maksimumi i elementeve te vektorit eshte:"<<max<<endl;
   cout<<"maksimumi i elementeve te vektorit eshte:"<<min<<endl;
    system("PAUSE");
    return EXIT_SUCCESS;
    
}
Editor is loading...
Leave a Comment