Chat with our AI personalities
To swap two numbers N1 and N2, using a third variable T... T = N1; N1 = N2; N2 = T;
class Program { static void Main(string[] args) { int n1, n2, n3,i; n1 = 0; n2 = 1; for (i = 1; i <= 20; i++) { n3 = n1 + n2; if (n3 <= 200) { Console.WriteLine(n3); n1 = n2; n2 = n3; } } Console.ReadKey(); } }
public int findSum(int n1, int n2) { return n1 + n2; }
Because a transformer does not generate power, it transformers it. Power is equivalent to the voltage times current. A transformer with a ratio of N1:N2 takes voltage (V1) and current (I1) at one winding and transforms it into (N2/N1)*V1 voltage and (N1/N2)*I1 current at the other winding. So the input power is V1 * I1, and the output power is (N2/N1)*V1*(N1/N2)*I1 = V1*I1 (ignoring the small amount of losses associated with the transformer).
n1=val(text1.text) n2=val(text2.text) n3=val(text3.text) text4.text=(n1*n2*n3)/100