Advertisement
adventuretimeh

num multipli

Feb 9th, 2020
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. #include <time.h>
  5. #include <conio.h>
  6.  
  7. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  8. //Scrivi un programma che esegue la somma di tutti i numeri multipli di 5 compresi tra 10 e 100//
  9.  
  10.  
  11. int main(int argc, char *argv[]) {
  12.    int num, somma;
  13.     somma=0;
  14.     num=10;
  15.    while((num>=10)&&(num<=100))
  16.    {
  17.     somma=num+somma;
  18.     num=num+5;  
  19.    }
  20.      printf ("\nLa somma e' %d", somma);
  21.    
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement