Jump to content

Ошибка в написании программы


Recommended Posts

вот задание:

Подсчитать и вывести на экран значение функции y (x), где х - целое число:

8be84d7f3b51.jpg

#include <stdio.h>

#include <math.h>

#include <conio.h>

int main()

{ int x; double y;

printf ("Bbedit x \n");

scanf ("%d",&x);

switch (x)

{ case 20: y=10; break;

case 10: y=(double log)(fabs(x)); break;

case 1: y=fabs(pow(x)1/4); break;

case 5.6: y=tan(x)+fabs(x); break;

default: y=atan(x);

}

printf ("y= %d"&x);

getch ();

return 0;

}

что тут не правильно?помогите пожалуйста.

Link to comment
Share on other sites

Riki_Tiki_Tavi:

#include <stdio.h>#include <math.h>#include <conio.h>int main(){ int x; float y;printf ("Bbedit x \n");scanf ("%d",&x);switch (x){ case 20: y=10; break;case 10: y=log(fabs(x)); break;case 1: y=fabs(pow(x,4)); break;case 5: case 6: y=tan(x)+fabs(x); break;default: y=atan(x);}printf ("y=%f",y);getch ();return 0;}
Link to comment
Share on other sites

Riki_Tiki_Tavi:

#include <stdio.h>#include <math.h>#include <conio.h>int main(){ int x; float y;printf ("Bbedit x \n");scanf ("%d",&x);switch (x){ case 20: y=10; break;case 10: y=log(fabs(x)); break;case 1: y=fabs(pow(x,4)); break;case 5: case 6: y=tan(x)+fabs(x); break;default: y=atan(x);}printf ("y=%f",y);getch ();return 0;}

Спасибо огромное за помощь!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...