#include <stdio.h> #include <iostream> #include <conio.h> float Addition(float N1, float N2) { return N1 + N2; } void Cal(){ int Cmd; float N1, N2; float (*Rs)(float N1,float N2) = NULL; std::cout << "Menu \n" << "[1] Addition \n" << "[0] Exit \n"; scanf("%i", &Cmd); system("cls"); //clrscr(); switch (Cmd) { case 1: Rs = Addition; break; default: return; break; } std::cout << "Enter first value \n"; scanf("%f", &N1); std::cout << "Enter second value \n"; scanf("%f", &N2); std::cout << "Result = " << Rs(N1, N2) << " \n \n"; Cal(); } int main(){ Cal(); }

Comment

Comment:

Tweet

Richter View my profile