Fondamenti di Programmazione a.a. 2009-2010 (canale E-O)

Docente: Riccardo Silvestri
Esercitatore: Paul Wollan

Laboratorio di mercoledì 7 ottobre 2009

  1. Scrivete un programma che prende in input quattro interi e quindi visualizza la somma, la media, il prodotto, il più piccolo e il più grande di questi numeri. Per esempio:
    Input four different integers: 4 6 8 10 
    Sum is: 28 
    Average is: 7 
    Product is: 1920 
    Smallest is: 4 
    Largest is: 10 
    
  2. Scrivete un programma che prende in input tre interi e li stampa in ordine crescente. Provate con quattro interi in input.
  3. Scrivete un programma (usando il while) per produrre la seguente tabella di valori:
    A    A+2  A+4  A+6 
    3    5    7    9 
    6    8    10   12 
    9    11   13   15 
    12   14   16   18 
    15   17   19   21 
    
  4. Scrivete un programma che legge un carattere c e un intero n e stampa un triangolo di altezza n fatto con caratteri c. Per esempio:
    Input a character: * 
    Input an integer: 4 
    * 
    ** 
    *** 
    **** 
    


This topic: Programmazione1 > WebHome > FP_EO > FPdiario0910 > FPlab071009
Topic revision: r1 - 2009-10-12 - RiccardoSilvestri
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback