Professional Documents
Culture Documents
The Islamia University: Submitted To
The Islamia University: Submitted To
The Islamia
University BAHAWALPUR
Submitted to
Mr. Hamza Rafique
ALPUR
By
Iqra perveen
FA19M2MA008
MCS 3rd
2019-2021.Morning
Visual Programming Assignment 2.
enter values and operation and program will calculate Result according to the
given operation
Solution
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HelloWorld
class Program
int x=20;
int y=10;
int s=0;
Console.WriteLine("Enter operator:");
string op = Console.ReadLine();
//char op='+';
switch (op)
__Page: 3__
case '+':
s=x+y;
break;
case '-':
s=x-y;
break;
case '*':
s=x*y;
break;
case '/':
s=x/y;
break;
default:
Console.WriteLine("wrong operator");
break;
Console.ReadLine();
}
__Page: 4__