Advertisement
Schknheit

1q - 29/04/15

Apr 29th, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. //Mostra a soma dos pares e dos impares.
  2.  
  3. #include <stdio.h>
  4.  
  5. int main(){
  6.    
  7.     int x,y,cont;
  8.    
  9.     for(cont = 0; cont <= 10; cont++){
  10.        
  11.         if(cont%2==0){
  12.             x = cont + cont;
  13.         }
  14.         else{
  15.             y = x + cont;
  16.         }
  17.     }
  18.    
  19.     printf("%d\n",x);
  20.     printf("%d\n",y);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement