What's new

Reviewer FREE CHEGG UNLOCKS

1623152685940.png
1623152737332.png
 

Attachments

using System;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Please Enter a Number");

//read number from user
int number =Convert.ToInt32(Console.ReadLine());

//invoke the static method
int SumOfPrimeNumbers = RecursivePrimeSum(number);

//print the sum of all prime numbers untill "number"
Console.WriteLine("sum of all prime numbers until " +number+ " = "+ SumOfPrimeNumbers.ToString());

}
public static int RecursivePrimeSum(int number)
{
if (number == 1)
{
return 1;
}
else if (is_prime(number) == 1)
{
// If number is a prime number, add the number to the return value
return (number + RecursivePrimeSum(number-1));
}
else
{
// If number is not a prime number, go to the next number
return RecursivePrimeSum(number-1);
}
}
public static int is_prime(int num)
{
int Prime = 1;
// return 0 for all negative numbers
if (num <=0)
{
return 0;
}
// Check if atleast one number is a factor of the given number
// Note: we just need to verify until number/2 to confirm the prime number

for(int i=2;i<=(num/2);i++)
{
if ((num%i)==0)
{
Prime = 0;
break;
}
}
return Prime;
}
}
 
Recursive method that shows all composite numbers starting from the given number down to 1.

using System;



public class Program{



long res = 1;

for (int i = 2; i <= n; i++) {

res *= i;

}

return res;

}



static void printNComposite(int n) {

long fact = factorial(n + 1);

for (int i = 2; i <= n + 1; ++i) {

Console.Write(fact + i + " ");

}

}



// Driver program to test above function

public static void Main() {

int n = 4;

printNComposite(n);



}

}

I hope this answer helped you. Pls put a thumb up.

Thank you.
 
Let's take x moles of NaBr, y moles of NaI and z moles of NaNO3
molar mass of
NaBr = 102.8
NaI = 149.8
NaNO3 = 84.9
AgBr = 187.7
AgI = 234.7
AgCl = 143.3
so,
Writing the mass balance initially
0.8612 = x*102.8 + y*149.8 + z*84.9 ------------(1)

Now the number of mole of Br- and I- will remain same as x and y, so we can write another mass balance
1.0816 = x*187.7 + y*234.7 -------------(2)

Now when the precipitate is converted into AgCl again the number of moles will be same and thus I have written another mass balance,
0.7125 = (x+y)*143.3 ------------(3)

Solving (2) and (3) for x and y we get
x = 1.816*10-3
y = 3.156*10-3

Puttin these values in (1) and solving for z we get

z = 2.376*10-3

or the mass of NaNO3 is 0.20gm

%w/w of NaNO3 will be = 0.2/0.8612*100 = 23.22% ANSWER
 
Back
Top