PDF4PRO ⚡AMP

Modern search engine that looking for books and documents around the web

Example: tourism industry

Esercizi su Array - polimi.it

Esercizi Aggiuntivi su Array e Stringhe Credits Prof. Campi Esercizio 1. Scrivere un programma in C che legge un vettore di interi di dimensione fissata e ne stampa la somma #include < >. #define LUNG 5. int main() {. int vett[LUNG],i,sum=0;. printf("Inserire un vettore di interi di dimensione %d\n", LUNG);. for (i = 0; i < LUNG; i++). scanf("%d", . /* Somma gli elementi del vettore */. for (i = 0; i < LUNG; i++) {. sum=sum+vett[i];. }. /* Stampa la somma */. printf( Somma: %d\n", sum);. return 0;. }. Esercizio 2. Scrivere un programma in C che legge un vettore di interi di dimensione fissata, inverte il vettore e lo stampa. #include < >. #define LUNG 5. int main() {. int vett[LUNG],i,temp; /*usata per scambiare due elementi del vettore */.)}

Esercizio 5 • Si scriva un programma C che all'interno del main consenta di inizializzare da tastiera un vettore di interi di lunghezza massima

Loading..

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Spam in document Broken preview Other abuse

Transcription of Esercizi su Array - polimi.it

Related search queries