Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. //Prototipo para funcao que verifica se eh multiplo
  5. int verificaMultiplo(int i, int j, int z);
  6.  
  7. //Programa principal
  8. int main() {
  9.  
  10. int i,j,w,x=0,cont=0;
  11. printf("Digite os numeros:i,j e w\n");
  12. scanf("%d %d %d", &i, &j, &w);
  13. while(cont<i) {
  14.  
  15. if(verificaMultiplo(j,w,x)==1) {
  16.  
  17. printf("%d\n", x);
  18. cont++;
  19.  
  20. }
  21.  
  22. x++;
  23.  
  24. }
  25.  
  26. system("pause");
  27.  
  28. }
  29.  
  30.  
  31. //Funcao de verificao
  32. int verificaMultiplo(int i,int k,int x) {
  33.  
  34. if(((x%1)==0) || (x%k==0)) {
  35.  
  36. return 1;
  37.  
  38. }
  39.  
  40. return 0;
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement