This c program ask user to input an integer and then prints it. Input is done using scanf function and number is printed on screen using printf.
C programming code
Download integer program.
Output of program:
In c language we have data type for different types of data, for integer data it is int, for character date char, for floating point data it's float and so on. For large integers you can use long or long long data type. To store integers which are greater than 2^18-1 which is the range of long long data type you may use strings. In the below code we store an integer in a string and then display it.
C program to store integer in a string
Output of program:
Advantage of using string is that we can store very very large integers. C programming language does not has a built in type to handle large numbers.
No comments:
Post a Comment