0

variable char is used for ?? like int is use for integer and double is use for fraction decimal

30th Jul 2018, 9:09 AM
Aquib Ahmed
Aquib Ahmed - avatar
8 Antworten
0
int - integer values Ex: -1,-77,9, 666 char - Character values Ex: '33', '0', 'a', 'b', '-88', '@', '
#x27; Numbers are also characters. So don't get confused.
30th Jul 2018, 9:25 AM
Akib
Akib - avatar
0
character
30th Jul 2018, 9:18 AM
Dan Walker
Dan Walker - avatar
0
char is used for character. For eg : If you want to print a character like a you need to use char. Hope this helps ☺️☺️.
30th Jul 2018, 9:19 AM
Meet Mehta
Meet Mehta - avatar
0
if numbers are also characters so then i can use anyone char or integer for a value like 5 ?
30th Jul 2018, 9:29 AM
Aquib Ahmed
Aquib Ahmed - avatar
0
There is the problem. You can calculate with int but not char. Characters such as '5' or '77' has different value than 5,77. Notice that I am using quotes. You can use functions to make characters int but you can't do arithmetic operations before typecasting or changing them to integers.
30th Jul 2018, 9:34 AM
Akib
Akib - avatar
0
ohh okay alright thank you :)
30th Jul 2018, 9:35 AM
Aquib Ahmed
Aquib Ahmed - avatar
0
Suppose you want to write a post something like "5 is not working in this code" //string =>group of characters. Here 5 is a character not a int. So its depends whether to use char or int for numbers. Hope this helps ☺️☺️.
30th Jul 2018, 9:39 AM
Meet Mehta
Meet Mehta - avatar
0
yeah thanx this helps MEET :))
30th Jul 2018, 9:41 AM
Aquib Ahmed
Aquib Ahmed - avatar