0

C language

#include <stdio.h> int main() { int i ; int degrees [5] = {310,320,330,340,350} ; for (i=0;i<5; i++) { degrees[i]=degrees[i]* (100/350) ; printf("Your percentages is %d \n",degrees[i]) ; } return 0; } When I write this code i have this output Your percentages is 0 Your percentages is 0 Your percentages is 0 Your percentages is 0 Your percentages is 0 but when i change this line degrees[i]=degrees[i]* (100/350) ; to degrees[i]=degrees[i]* 100/350 ; output be Your percentages is 88 Your percentages is 91 Your percentages is 94 Your percentages is 97 Your percentages is 100 why there is a problem with using ( ) ?

14th Jul 2019, 9:13 AM
Farag Elsayed Abdelrahman
Farag Elsayed Abdelrahman - avatar
1 Answer
0
I got it , thank you ^^ .
14th Jul 2019, 3:11 PM
Farag Elsayed Abdelrahman
Farag Elsayed Abdelrahman - avatar