fork(1) download
  1. #include <stdio.h>
  2. int GreatestOddDivisor(int j);
  3.  
  4. int main()
  5. {
  6. int result=0;
  7. int q;
  8. int l,r;
  9. int j=0;
  10. q=1;
  11.  
  12. printf("\n");
  13. l=3;
  14. r=5;
  15. int d;
  16. d=r-l;
  17.  
  18. for (j =l; j<=r; j++)
  19. {
  20. printf("%d \t",j);
  21.  
  22. }
  23. printf("%d",result);
  24. return 0;
  25.  
  26.  
  27. }
  28. int GreatestOddDivisor(int j)
  29. {
  30. if (j % 2 != 0)
  31. {
  32. return j;
  33. }
  34. else
  35. {
  36. for (int i = 1; i < j ; i++)
  37. {
  38. if (j % i == 0 && i % 2 != 0 )
  39. {
  40. return i;
  41. }
  42. }
  43. }
  44. }
  45.  
  46.  
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
3 	4 	5 	0