Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Coded By Sumit...! */
- #include <stdio.h>
- #include <limits.h>
- #include <string.h>
- #include <conio.h>
- void main()
- {
- char str[100] = {0};
- clrscr();
- printf("Enter datatype: ");
- strlwr(gets(str));
- if(strcmp(str, "int") == 0)
- printf("%d to %d", INT_MIN, INT_MAX);
- else if(strcmp(str, "char") == 0)
- printf("%d to %d", CHAR_MIN, CHAR_MAX);
- else if(strcmp(str, "long") == 0)
- printf("%d to %d", LONG_MIN, LONG_MAX);
- else if(strcmp(str, "short char") == 0)
- printf("%d to %d", SCHAR_MIN, SCHAR_MAX);
- else if(strcmp(str, "short") == 0)
- printf("%d to %d", SHRT_MIN, SHRT_MAX);
- else if(strcmp(str, "unsigned char") == 0)
- printf("%d to %u", 0, UCHAR_MAX);
- else if(strcmp(str, "unsigned int") == 0)
- printf("%d to %u", 0, UINT_MAX);
- else if(strcmp(str, "unsigned long") == 0)
- printf("%d to %u", 0, ULONG_MAX);
- else if(strcmp(str, "unsigned short") == 0)
- printf("%d to %u", 0, USHRT_MAX);
- else
- printf("Not a valid data type");
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement