#include<stdio.h>
#include<stdlib.h>
int main(){
float x;
x=4/(4-1);
printf("%f\n", x);
}
when I try to run that on c it makes x equal to 1, i don´t understand why
#include<stdio.h>
#include<stdlib.h>
int main(){
float x;
x=4/(4-1);
printf("%f\n", x);
}
when I try to run that on c it makes x equal to 1, i don´t understand why
Because you are making a division between two int, so you'll obtain an int as result.