Declare four string variables. Declare each one separately. Do not initialize the variables.
Then write the above question so that all variables are declared at once
here you will see 2 programing languages for implementing vaiable in c and java.
In c::
string means::string is a collection of characters in a linear sequence.
In 'C' always treats a string a single data even though it contains whitespaces .
examples:: syntax :: datatype <variable_name>[size]; char variable1[30]; //declaration of a string variable1 char variable2[30]; //declaration of a string variable2 char variable3[30]; //declaration of a string variable3 char variable4[30]; //declaration of a string variable4
Note: : c compiler automatically adds a NULL character ' \0' to the character array created..
in Java::
String variable1; //declaration of a string
String variable2; //declaration of a string
String variable3; //declaration of a string
String variable4; //declaration of a string
Get Answers For Free
Most questions answered within 1 hours.