Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <tgmath.h>
- typedef double complex point_t;
- static inline double sq_norm(point_t p) { return p * conj(p); }
- int main(void) {
- printf("Keyin x and y values >> ");
- fflush(stdout);
- double x, y;
- if (scanf("%lf%lf", &x, &y) == 2) {
- point_t p = CMPLX(x, y);
- printf("%.1f\n", sq_norm(p));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement