Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

DEV C++ patulong mga IT dian pleaseee...

Linkcen

Recruit
Basic Member
Messages
1
Reaction score
0
Points
16
pwd po bang patulong sa dev c++ lalo na switch statement gagwa po kc akong program dapat ung output nya ganito


Enter 1st number:
Enter 2nd number:

A-addition
S-subraction
M-multiplcation
D-division

Enter Operation:

Result it:
 
pwd po bang patulong sa dev c++ lalo na switch statement gagwa po kc akong program dapat ung output nya ganito


Enter 1st number:
Enter 2nd number:

A-addition
S-subraction
M-multiplcation
D-division

Enter Operation:

Result it:

TS hindi ko sure kung ito gusto mu.
modify mu nalang sa pinaka gusto mu na output.
baka kasi my gusto ka pa baguhin..
hope this will help you.. :thumbsup:

Code:
#include <iostream>
#include <ctype.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
	int fnumber, snumber,result;
	char opchoice;
	cout<< "Enter 1st number: ";
	cin >> fnumber;
	cout << "Enter 2nd number: ";
	cin>> snumber;
	cout <<"\nSelect Operation\nA-Addition\nS-Subraction\nM-Multiplcation\nD-Division\n";
	cout <<"Enter Operation: ";
	cin >> opchoice;
	switch(toupper(opchoice))
	{
	case 'A':
		result = fnumber + snumber;
		break;
	case 'S':
		result = fnumber - snumber;
		break;
	case 'M':
		result = fnumber * snumber;
		break;	
	case 'D':	
		result = fnumber / snumber;
		break;
  	default :
                cout << "Invalid operation" << endl;			
	}
                cout << "\nResult is: " << result;
	return 0;
}
 
Last edited:
Back
Top Bottom