Data type in C :
Data type :- Data type is used to declelared the types of the data being use in variable .The amount of memory consumed by a variable and the capacity of variable depond upon the data type of variable in C language there are following data types.
1. Int data type :- Int data type is used to store numeric value . It occupied 2-byte , its range will be from -32768 to +32767. ("0" consider as posative ).
2. Long int :- Long int is used to store long numeric value . It occupied 4-byte of computer memory , range will be from - 2147483648 to +2147483647.
3. Unsingned integer and unsingned long integer :- some time we know in advance that the value store in a given variable will always be posative(+ve) when it is being used for counting things only .
like - number of things(eg- student) in class. number of worker in dipartment .
in such case , we can declered the variable as unsign. If we declered the variable unsign then it will store only posative data ,its negative capacity will be shifted to posative capacity.
for example - If we declered a variable as unsign integer . It will be consume 2-byte and its renge will shifted from the range -32768 to +32767 to the range 0 to +65535.
if we declered unsign long integer then it will be consume 4-byte & its range will be shifted from , the range -2147483648 to 2147483647 to the range 0 to +4294967295.
4. char data type :- Char is used to store alphabetes as will as character belongs to ASCII(American Standard Code of Information Interchange ) character set .
ASCII CHAR ASCII CHAR
65 A 97 a
66 B 98 b
67 C 99 c
68 D 100 d
69 E 101 e
70 F 102 f
71 G 103 g
72 H 104 h
73 I 105 i
74 J 106 j
75 K 107 k
76 L 108 l
77 M 109 m
78 N 110 n
79 O 111 o
80 P 112 p
81 Q 113 q
82 R 114 r
83 S 115 s
84 T 116 t
85 U 117 u
86 V 118 v
87 W 119 w
88 X 120 x
89 Y 121 y
90 Z 122 z
ASCII for Number :
ASCII CHAR
48 1
49 2
50 3
... ....
EXAMPLE :-
Write a program for print "A" or "a".
#include<stdio.h>
#include<conio.h>
main()
{
char g=65,k=97;
clrscr();
printf("%c\n",g);
printf("%c ",k);
getch();
}
Output:
A
a
Input:-
Read More:https://khoobstudy.blogspot.com/2022/11/program-for-hello-word-good-morning.html
Thank you for reading...
Top concept
ReplyDeleteBest
ReplyDelete