Answers for "atol c."

C
0

atol c.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main () {
   long val;
   char str[20];
   
   strcpy(str, "98993489");
   val = atol(str);
   printf("String value = %s, Long value = %ld\n", str, val);

   strcpy(str, "tutorialspoint.com");
   val = atol(str);
   printf("String value = %s, Long value = %ld\n", str, val);
	
   return(0);
}
Posted by: Guest on February-12-2021

Code answers related to "C"

Browse Popular Code Answers by Language