Samsung Galaxy Note, 4G LTE Plans, Transfer Photos Videos from iPhone to Samsung, Network Performance, Mobile Accounts, Furious Gold SPD TooL, Latest Version Full Setup

Info C# Program using Two argument passing function

Info C# Program using Two argument passing function - this blog we have built from a few years ago and already very much information about gadgets that we convey and a lot of blog visitors New Blog Techno News who are satisfied with the information, we will always try to update the latest information for you, first about Info C# Program using Two argument passing function many already we collect data to make this article so you do not miss the news, please see:

Articles : Info C# Program using Two argument passing function
full Link : Info C# Program using Two argument passing function
Article Csharp, Article programs,

You can also see our article on:


Info C# Program using Two argument passing function

C# Program using Two argument passing function

Program Statement:
Write a function which takes two values n1 and n2 as arguments and multiply the n1 by itself n2 times i.e. calculate n1n2 and then return the result to main function which will display the result.

Solution:
 class power_fun
{
double x;
public
power_fun()
{
x = 1;
}
double power(int a,int b)
{

for (int i = 1; i <= b; i++)
{
x = x * a;
}
return x;
}

static void Main(string[] args)
{
power_fun p = new power_fun();
int n1, n2;
double result;
Console.Write("Enter 1st Value: ");
n1 = Convert.ToInt32(Console.ReadLine());
Console.Write("Enter 2nd Value: ");
n2 = Convert.ToInt32(Console.ReadLine());
result= p.power(n1, n2);
Console.WriteLine(n1+"^ "+ n2+" = "+ result);
Console.ReadLine();
}




articles Info C# Program using Two argument passing function finished in discussion

hopefully the information we convey about Info C# Program using Two argument passing function can benefit you in getting new knowledge about technology,

you just finished reading the information Info C# Program using Two argument passing function we hope this informmation can answer the question you submit to googlle, if you want to bookmark or share please use link https://moymoycikukecik.blogspot.com/2013/12/info-c-program-using-two-argument.html and do not forget to always visit this blog to get the latest information every day.

Tag : , ,
Share on Facebook
Share on Twitter
Share on Google+
Tags :

Related : Info C# Program using Two argument passing function

0 komentar:

Posting Komentar