answersLogoWhite

0


Best Answer
C#.net ProgramsProgram # 1:This program takes three positive numbers from user. Compute and display the average of the two larger numbers.

using System;

using System.Collections.Generic;

using System.Text;

namespace Average_of_three_Nos

{

class Program

{

static void Main(string[] args)

{

string no1, no2, no3;

int n1, n2, n3;

int average;

Console.WriteLine("Enter First Number");

no1 = Console.ReadLine();

n1 = Int32.Parse(no1);

Console.WriteLine("Enter Second Number");

no2 = Console.ReadLine();

n2 = Int32.Parse(no2);

Console.WriteLine("Enter third Number");

no3 = Console.ReadLine();

n3 = Int32.Parse(no3);

average = (n1 + n2 + n3) / 3;

Console.WriteLine("Average of three Numbers : "+ average);

}

}

}

Program #2:This program will take two positive numbers as its input and then find GCD of them.

using System;

using System.Collections.Generic;

using System.Text;

namespace GCD

{

class Program

{

static void Main(string[] args)

{

Program obj = new Program();

string no1, no2;

int n1, n2;

Console.WriteLine("Enter First Number");

no1 = Console.ReadLine();

n1 = Int32.Parse(no1);

Console.WriteLine("Enter Second Number");

no2 = Console.ReadLine();

n2 = Int32.Parse(no2);

int g=obj.find_gcd(n1, n2);

Console.WriteLine("GCD=" + g);

}

int find_gcd(int a, int b)

{

int c;

if(a

{

c = a;

a = b;

b = c;

}

while(true)

{

c = a%b;

if(c==0)

return b;

a = b;

b = c;

}

}

}

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C sharp dot net example programs for beginers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Which of these programs java php dot net c c plus plus c sharp sql HTML will design a desktop application better?

Java and .Net can create good desktop applications both. Java provides manual configuration of all features.


What is the meaning of dot in dot net?

How the Microsoft .Net ?Name has come? Is there any reason dot before Net? for example Java having some history behind name so like wise is there any reason putname like .netHi,I want to know the meaning of dot in .NET. But NET means NETWORK ENABLED TECHNOLOGIES. I came to know there was meaning for dot. Iam very excited to know the meaning of dot as soon as possible.P.MANOHAR


What is dot in Japanese?

Two common words meaning 'dot': 点 (てん) = 'point'; 'dot', as in 'draw a dot on a paper' ドット (どっと) = 'dot', as in 'www dot google dot com'


Which sign is used to concatenate two strings?

That depends on the programming language. Most languages use the "+" sign, but a few use other signs. For example, PHP uses the dot.


What is use of dot operator in java?

"the dot" connects classes and objects to members. The places where you use it in what I cover are:(1) when you are connecting an object reference variable to a method. The Extending Existing Classes lesson introduces the dot operator for this use, and(2) when you are connecting a class name to one of its static fields. An example of this is the dot between "System" and "out" in the statements we use to print stuff to the console window. System is the name of a class included in every Java implementation. It has an object reference variable that points to a PrintStream object for the console. So, "System.out.println( "text") invokes the println() method of the System.out object.

Related questions

What do you call the extension after the dot for example dot com dot net dot org?

commercial for com


What are the top pathology residency programs?

Unfortunately, there is no actual ranking system for pathology residency programs or pathology fellowship programs. However, there is a Pathology Resident Wiki (pathinfo dot wikia dot com) that has a complete pathology residency program directory and pathology fellowship program directory. Another good source of info is studentdoctor dot net.


How do you get past level 2 on extreme parking mania?

on the red dot turn a sharp turn i guess


Which of these programs java php dot net c c plus plus c sharp sql HTML will design a desktop application better?

Java and .Net can create good desktop applications both. Java provides manual configuration of all features.


Can you have an example of a short sentence using the word dot?

Put your left hand on the red dot.


Can you make web app in c sharp dot net without using asp dot net?

Yes. But Asp.net is a framework to ease the pain of constructing a web app from the ground up.


'What was the impact of the telegraph on American history'?

It was a use of communication.And helped by letting people communicate faster and easier, it made lives of the people more convenient and helped out with military and was a dot-dash code, for example SOS was transmitted as-"dot-dot-dot,dash-dash-dash,dot-dot-dot!"


What does a dot net developer do?

his basic job is to create and handle websites the important languages which are required are c sharp(c#) and vb


Can a not for profit company use a dot com?

Yes. (I do, for example.)However, it would likely be expected to use a dot org.


How do you make a nose?

First, put a dot in the corner of your paper. Then, roll the paper up, leaving the tip sharp. There! Now you have a nose cone!


What does dot co dot in in internet mean?

Depending on the site it could mean COUNTY.. for example www.co.portage.wi.us is the website for portage county, WI.


What does closed circle mean in math?

Multipy by whatever is there in the following example the * is the dot (example 6*9=54