Clr Error?
Please Point out any error if there in this CLR Console Program.
This is Simple addition program.
source code:
// Powe.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
int c = 0,a = 0,b = 0;
Console::WriteLine(L"Enter two No.");
a = Console::Read();
b = Console::Read();
c = a + b;
Console::WriteLine(L"The Addition is {0}",c);
return 0;
}
The Program Compiles and also executes properly.
But the addition is not performed as Expected.
The lines that appear on the console are:
Enter two No.
4 5
The Addition is 84
so,why such a error.
It should come 9.
so,Please help me to get out of this situation and also give me the
error-free source code of this Simple CLR addition program
pranav
|