6

#1
#include<stdlib.h>
#include<stdio.h>
#include<math.h>
int main(void)
{
double x,y;
int a,b,c;
char c1,c2;
printf("introduceti 3 valori reale\n");
if(scanf("%lf %lf", &x, &y)!=2)
{
printf("date eronate");
exit(1);
}
printf("introduceti 3 nr intregi\n");
if(scanf("%d %d %d", &a,&b,&c)!=3)
{
printf("date eronate");
exit(1);
}
printf("introduceti 2 caractere\n");
fflush(stdin);
scanf("%c %c", &c1, &c2);
printf("valorile introuduse sunt: x=%g\t y=%g \ta=%d \tb=%d \tc=%d \tc1=%c \tc2=%c", x,y,a,b,c,c1,c2);
double fx;
if(x<0)
fx=pow(2,x)+log(fabs(x));
else if(x==0)
fx=0;
else if(x>0)
fx=(sqrt(9+pow(x,2))+cos(x))/(2*x);
printf(" valoarea lui fx=\n%g", fx);
return 0;
}
cron