Language Turbo C 2.0
Input and extern functions */
#include <conio.h>
#include <math.h>
#include <stdio.h>
char a;
/* Functions declaration */
g (int);
float j (float);
float k (float);
float l (float);
float m (float (*d) (float));
float n (double (*d) (double));
main ()
{
int d;
float p, q;
float (*s) (float);
double (*t) (double);
printf ("55.42. Press any key: ");
a = getche ();
printf ("\nInput integer: ");
scanf ("%i", &d);
g (d);
p = 1.1;
s = j;
printf ("\n\n116.43. ");
q = (*s) (p);
printf ("(5) p = %.4g, q = %.4g.\n", p, q);
q = s (p);
printf ("(6) p = %.4g, q = %.4g.\n", p, q);
t = sin;
q = t (p);
printf ("(7) p = %.4g, q = %.4g.\n", p, q);
q = (*t) (2.5);
printf ("(8) p = %.4g, q = %.4g.\n", p, q);
q = m (k);
printf ("(9) p = %.4g, q = %.4g.\n\n", p, q);
q = n (cos);
printf ("(10) p = %.4g, q = %.4g.\n", p, q);
q = m (s);
printf ("(11) p = %.4g, q = %.4g.\n", p, q);
getch ();
printf ("\n");
}
g (int d)
{
int e;
if (d > 80) d = 80;
for (e = 0; e < d; e++) printf ("%c", a);
}
float j (float d)
{
puts ("(1) In j ().");
return d;
}
float k (float d)
{
puts ("(2) In k ().");
return d * d;
}
float l (float d)
{
puts ("(3) In l ().");
return d * d * d;
}
float m (float (*d) (float e))
{
printf ("(4) In m (), %.4g.\n", d (3));
return d (3);
}
float n (double (*d) (double e))
{
printf ("(12) In n (), %.4g.\n", d (3.01));
return d (3.01);
}
Присоединяйтесь — мы покажем вам много интересного
Присоединяйтесь к ОК, чтобы подписаться на группу и комментировать публикации.
Нет комментариев