+ 2
Can anyone help me to make c code of this.
1) Declare FOP, PST, CaL, Eng, ITC, PHY; 2) Input FOP, PST, CaL, Eng, ITC, PHY; 3) Declare and initialize int i = 0 4) IF FOP<50 print FOP and i = i + 1 . 5) IF PST<50 print PST and i = i + 1 6) IF ENG<50 print ENG and i = i + 1 7) IF PHY<50 print PHY and i = i + 1 8) IF CaL<50 print Cal and i = i + 1
2 odpowiedzi
+ 1
#include <stdio.h>
int main() {
int FOP, PST, CAL, ENG, ITC, PHY;
scanf("%d %d %d %d %d %d", &FOP, &PST, &CAL, &ENG, &ITC, &PHY);
int i = 0;
if(FOP<50) printf("FOP= %d ,i++= %d\n",FOP,++i);
if(PST<50) printf("PST= %d ,i++= %d\n",PST,++i);
if(ENG<50) printf("ENG= %d ,i++= %d\n",ENG,++i);
if(PHY<50) printf("PHY= %d ,i++= %d\n",PHY,++i);
if(CAL<50) printf("CAL= %d ,i++= %d\n",CAL,++i);
if(ITC<50) printf("ITC= %d ,i++= %d\n",ITC,++i);
return 0;
}
+ 2
Thank you so much