برنامه ای بنوسید که مقدار x را از ورودی بگیرد و حاصل تابع زیر را محاسبه و در خروجی چاپ نماید.
تابع اول 
#include <iostream>
#include <conio.h>
#include <math.h>

main()
{
float x,y;
cout << "Enter X: ";
cin>>x;
if(x>0)
y=sqrt(7*pow(x,2)+5*x+3)/9;
else if(x==0)
y=0;
else
y=sqrt(pow(x+4,2)+1);


cout<<"Y: "<<y;
getch();
}
تابع دوم 
#include <iostream>
#include <conio.h>
#include <math.h>

main()
{
float x,y;
cout << "Enter X: ";
cin>>x;
if(x>0)
y=sqrt(x+2)/(x-5);
else if(x==0)
y=0;
else
y=pow(x+2,2)-x+3;
cout<<"Y: "<<y;
getch();
}