14,210,385 members

# Managed C++/CLI

 Message Closed 27-Nov-17 21:16 Member 13545029 27-Nov-17 21:16
 Re: project \$50 reward need in 24 hours Pete O'Hanlon27-Nov-17 21:18 Pete O'Hanlon 27-Nov-17 21:18
 ISSUE - TCP/IP sockets in MFC VS2017 D.Manivelan21-Nov-17 1:22 D.Manivelan 21-Nov-17 1:22
 Re: ISSUE - TCP/IP sockets in MFC VS2017 Jochen Arndt21-Nov-17 1:59 Jochen Arndt 21-Nov-17 1:59
 Re: ISSUE - TCP/IP sockets in MFC VS2017 jschell22-Nov-17 9:05 jschell 22-Nov-17 9:05
 To sort an array of integer's with recursive functions ? Tarun Jha18-Nov-17 3:46 Tarun Jha 18-Nov-17 3:46
 Re: To sort an array of integer's with recursive functions ? PIEBALDconsult18-Nov-17 3:56 PIEBALDconsult 18-Nov-17 3:56
 To find hcf of n number by using only loops. Tarun Jha4-Nov-17 2:20 Tarun Jha 4-Nov-17 2:20
 This is the code i came up with but it's too long, how to short it down. ```#include #include int main(){ int i=0, j, num[100], count=0, k, hcf[50], min; //entering integers, Enter 0 to exit the loop. printf("Enter your numbers: \n"); do{ scanf("%d", &num[i]); i++; count++; }while(num[i-1]!=0); /* here we find the minimum number, because we want to find the common factor, hence the factor cannot be > min number entered cause then it will not be common factor in all. Therefore the min number enterd can be the highest factor or the factors can be <= the min int entered. */ min = num[0]; for(j=1; j<=count-2; j++){ if(min>num[j]) min = num[j]; } //in the code below we find the factors of every integer entered. int h=0, n[count-1]; for(j=0; j<=count-2; j++){ for(k=1; k<=min; k++){ if(num[j]%k==0){ hcf[h]=k; h++; } } n[j] = h; /*here h is the the size of the number of factors for every integer which is saved in n[] array*/ } /* In the loop below each factor of the 1st integer is compared with the factors of others number, And if the occurance of any factor of 1st is equal to the number of int intitially enterd then that is a common factor an it is saved in max[] array */ int c=0, max[50], z; for(i=0; i
`
 Re: To find hcf of n number by using only loops. Richard MacCutchan4-Nov-17 21:10 Richard MacCutchan 4-Nov-17 21:10
 Re: To find hcf of n number by using only loops. Tarun Jha7-Nov-17 6:20 Tarun Jha 7-Nov-17 6:20
 Re: To find hcf of n number by using only loops. Richard MacCutchan7-Nov-17 7:00 Richard MacCutchan 7-Nov-17 7:00
 Is every C# feature available in C++/Managed ? Maximilien11-Oct-17 7:26 Maximilien 11-Oct-17 7:26
 Re: Is every C# feature available in C++/Managed ? Richard MacCutchan11-Oct-17 9:50 Richard MacCutchan 11-Oct-17 9:50
 Re: Is every C# feature available in C++/Managed ? John Schroedl28-Nov-17 2:03 John Schroedl 28-Nov-17 2:03
 c++ Member 1340521911-Sep-17 21:51 Member 13405219 11-Sep-17 21:51
 Re: c++ Jochen Arndt11-Sep-17 22:41 Jochen Arndt 11-Sep-17 22:41
 Get USB drive letter Member 101933363-Aug-17 0:22 Member 10193336 3-Aug-17 0:22
 Re: Get USB drive letter Jochen Arndt3-Aug-17 1:10 Jochen Arndt 3-Aug-17 1:10
 Re: Get USB drive letter Member 101933363-Aug-17 2:31 Member 10193336 3-Aug-17 2:31
 Re: Get USB drive letter Jochen Arndt3-Aug-17 2:34 Jochen Arndt 3-Aug-17 2:34
 Re: Get USB drive letter Member 101933363-Aug-17 2:32 Member 10193336 3-Aug-17 2:32
 Re: Get USB drive letter Richard MacCutchan3-Aug-17 2:38 Richard MacCutchan 3-Aug-17 2:38
 Re: Get USB drive letter Member 101933363-Aug-17 2:43 Member 10193336 3-Aug-17 2:43
 Re: Get USB drive letter Jochen Arndt3-Aug-17 2:43 Jochen Arndt 3-Aug-17 2:43
 singly linked list Member 1306030217-Jul-17 23:27 Member 13060302 17-Jul-17 23:27
 Last Visit: 18-Jun-19 17:25     Last Update: 18-Jun-19 17:25 Refresh « Prev1234567891011 Next »