How to convert long to int in C

1 Answer

0 votes
#include <stdio.h> 
   
int main(void) 
{ 
    long l = 982924;
	int i = (int)l;
     
    printf("%i\n", i); 
     
    return 0; 
} 
  
  
  
/*
run:
  
982924
 
*/

 



answered Aug 5, 2019 by avibootz

Related questions

1 answer 192 views
1 answer 167 views
167 views asked Aug 6, 2019 by avibootz
1 answer 239 views
1 answer 230 views
1 answer 127 views
1 answer 182 views
...