Advertisement
M_Cracked

exercicio 1071

Feb 16th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <stdio.h>
  2. int main(){
  3. int num,g,num1,res;
  4. res=0;
  5. scanf("%d %d",&num,&num1);
  6. if(num1>num){
  7. for(g=num;g<=num1;g++){
  8. if(g%2!=0);
  9. res=g+res;
  10. }
  11. }
  12. if(num>num1){
  13. for(g=num1;g<=num;g++){
  14. if(g%2!=0);
  15. res=g+res;
  16. }
  17. }
  18. printf("%d\n",res);
  19.  
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement