Why do you think the answer should be what you say?
All your <= comparisons (lines 12 to 27 in your post) serve no purpose whatsoever.
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
double P1,Q1,v1,FC1;
double P2,Q2,v2,FC2;
double Pr1,Pr2,AnnPr;
scanf("%lf%lf%lf%lf",&P1,&Q1,&v1,&FC1);
scanf("%lf%lf%lf%lf",&P2,&Q2,&v2,&FC2);
Pr1=P1*Q1-(v1*Q1-FC1);
Pr2=P2*Q2-(v2*Q2-FC2);
AnnPr=Pr1+Pr2;
printf("Pr1=%lf\n",Pr1);
printf("Pr2=%lf\n",Pr2);
printf("AnnPr=%lf\n",AnnPr);
return 0;
}
$ gcc -Wall main.c
$ ./a.out
50 100 20 3000
1400 7840 860 17548
Pr1=6000.000000
Pr2=4251148.000000
AnnPr=4257148.000000
So is it Pr1 or Pr2 which is wrong in your estimation?
Failing that, try using the debugger to examine the program state in finer detail.
Code:
$ gcc -Wall -g main.c
$ gdb -q ./a.out
Reading symbols from ./a.out...done.
(gdb) b 17
Breakpoint 1 at 0x4006c2: file main.c, line 17.
(gdb) run
Starting program: /home/sc/Documents/a.out
50 100 20 3000
1400 7840 860 17548
Breakpoint 1, main () at main.c:17
17 printf("Pr1=%lf\n",Pr1);
(gdb) info locals
P1 = 50
Q1 = 100
v1 = 20
FC1 = 3000
P2 = 1400
Q2 = 7840
v2 = 860
FC2 = 17548
Pr1 = 6000
Pr2 = 4251148
AnnPr = 4257148
(gdb) c
Continuing.
Pr1=6000.000000
Pr2=4251148.000000
AnnPr=4257148.000000
[Inferior 1 (process 2961) exited normally]