Sum of prime numbers from 1 to N in c# public int SumOfPrimeNumberUptoN( int loopNumber) { List< string > collection = new List< string >(); int count=0, sum = 0; for ( int num = 1; num <= loopNumber; num++) { count = 0; for ( int i = 2; i <= num/2; i++) { if (num % i == 0) { ...
Comments
Post a Comment