Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42215

Math algorithm

$
0
0
I can't make application that will find The lowest common denominator and the greatest common divisor for n numbers. So basicly, application must take all numbers someone input then find the greatest common divisor and the lowest common denominator for all those numbers. How can I something like that. Also, can someone explain me how to solve this problem:
c Code:
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. int n[100];
  7. int i;
  8. int numbers;
  9. printf("How much numbers your want to add in array? \n");
  10. scanf("%d", &numbers);
  11. printf("Enter numbers: \n");
  12. for(i=0;i=n-1;i++) {
  13.       n[i] = scanf("%d",&n[i]);
  14.       }
  15.       for (i=0;i=n-1;i++) {
  16.       printf("%d \n",n[i]);
  17.       }
  18.   system("PAUSE")
  19.   return 0;
  20. }
I tried to take all the numbers someone input but application stop working for some reason and I don't know why.

Viewing all articles
Browse latest Browse all 42215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>