спасибо Добрый Человек)) может кому пригодиться
вот рабочая прога
Код:
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<math.h>
int main ()
{
float x, y;
printf("\nx= ");
scanf("%f", &x);
if (x<0 && x != -10)
{
printf("\nX out of range: negatives are forbidden!");
}
if (x>4)
{
do
{
x=x-4;
}while (x>=4);
}
if (x != -10)
{
if (x<1)
{
y = sqrt(1 - pow(x-1, 2));
}else{
if (x>=1 && x<3)
{
y = 1 - sqrt(1 - pow(x-2, 2));
}else{
y = sqrt(1 - pow(x-3, 2));
}
}
}
printf("\ny= %.2f",y);
_getch();
return 0;
}