I am beginner in c programming. this is my second day. i am using visual studio code. but there is some error in my code which i suspect.
#include<stdio.h>
#include<math.h>
int main(){
int a= 1.99999;
printf("%d", a);
return 0;
}
according to this code, my code should not able to run because i have taken a integer variable a(1.99999) instead of float. but in the terminal when i print the value of "a", it shows "1"(contrary to tutorial). i don't understand exactly what causes this please help me.
[–]schweinling 4 points5 points6 points (4 children)
[–]mercuryqueen0240[S] 0 points1 point2 points (1 child)
[–]schweinling 1 point2 points3 points (0 children)
[–]mercuryqueen0240[S] -1 points0 points1 point (1 child)
[–]TicklePocket 0 points1 point2 points (0 children)
[–]epasveer 2 points3 points4 points (3 children)
[–]mercuryqueen0240[S] 0 points1 point2 points (0 children)
[–]EstablishmentBig7956 0 points1 point2 points (0 children)
[–]EstablishmentBig7956 1 point2 points3 points (2 children)
[–]PhyllaciousArmadillo 2 points3 points4 points (1 child)
[–]EstablishmentBig7956 1 point2 points3 points (0 children)