Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
using system
namespace Project1
{
class Program
{
int a=1;
int b=2;
int c= a+b;
console.writeline(" enter your number", c);
then next???
Posted
Comments
Sergey Alexandrovich Kryukov 23-Dec-15 23:56pm    
Huh?
—SA
Dave Kreskowiak 23-Dec-15 23:58pm    
What do you mean "next"? That's entirely up to you and your requirements!
Sanjay K. Gupta 24-Dec-15 0:03am    
Your question is not clear and seems it is a home work type question.
I think you are in wrong field. You should try to build your career in other field instead of Programming. Best of luck!

1 solution

Try this

int a=0;
int b=0;
int c=0;

Console.WriteLine("Please enter first integer:");
a=int.Parse(Console.ReadLine());
Console.WriteLine("Please enter second integer:");
b=int.Parse(Console.ReadLine());
c=a+b;
Console.WriteLine(a.ToString() + " + " + b.ToString() " = " + c.ToString());
Console.ReadLine();
 
Share this answer
 
Comments
Raje_ 24-Dec-15 2:06am    
You just did his homework. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900