+ 1
I'm so dumb, 😂 i don't understand why int float and char used before a, b, salary and letter? Explain me yr.
#include <stdio.h> int main() { int a, b; float salary = 56.23; char letter = 'Z'; a = 8; b = 34; int c = a+b; printf("%d \n", c); printf("%f \n", salary); printf("%c \n", letter); return 0; }
6 odpowiedzi
+ 7
int is used for integer number which can be any number in negative or positive according to your need.
Ex
int a;
// a will contain integer values
Float is used for floating point value like
Float salary = 56.23
According to the ex you mention
Char is used for character or alphabets like
Char letter = 'a';
0
Sooo we write data type names according what value is?
0
And if we not write it than?
0
Lol i take a long time to understand your question. After the name of varible you must define the type of that variable. Are the rules of syntaxe of that language. Is the same for c++, java, c# and many more language like this language i indicate.