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 187 views
1 answer 162 views
162 views asked Aug 6, 2019 by avibootz
1 answer 232 views
1 answer 225 views
1 answer 125 views
1 answer 180 views
...