Convert the following C program into a C++ program. Showproof of compilation.
#include <stdio.h>
int user_interface();
double func(double);
void print_table();
int main (int argc, char *argv[]) {
print_table(user_interface());
return 0 ;
}
int user_interface(int val){
int input = 0;
printf(“This function takes in x and returns anoutputn”);
printf(“Enter Maximum Number of X:”);
scanf(“%d”, &input);
while(input <= 0) {
printf(“integers onlyn”);
while(getchar() != ‘n’);
scanf(“%d”, &input);
}
return input;
}
double func(double x){
int result;
if(x<5){
result = x*x;
}
else if ( x < 10 ) {
result=x*x – 3*x -10;
}
else {
result = x*x -7*x -8 ;
}
return result;
}
void
PayPal Gateway not configured
PayPal Gateway not configured