answersLogoWhite

0

long, short, char and bool are 4 valid variable types. There are many more available, including (but not limited to) float, double, int, wchar_t, size_t, as well as compound types (such as long long) and unsigned/signed variations, such as unsigned int. All of these types are primitive, integral or built-in data types. More complex data types can be formed from struct, class and union declarations, but they all simply build upon the integral types.

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering

Is special symbols are valid as a string in java?

Yes. Any special character inside the String is considered as part of the string variable and would not be treated as a special character. Ex: String str = "ABC_$4"; is a valid string declaration


What is a valid variable data type?

1. If its natural or integer numbers- Integer(Int) data type. 2. If it consists of decimal or fraction part- Double or float data type. 3. If it has a single letter or sign- Character(Char) data type. 4. If its got many words(alpha-numerical)- String data type. 5. If the result has to be "true" or "false"- Boolean data type.


How to wite the codes in C plus plus enter 4 integers?

#include<iostream> int main() { int n[4]; std::cout << "Enter 4 integers: " std::cin >> n[0] >> n[1] >> n[2] >> n[3]; } The above is naive because there's no error-checking to prevent garbage input. A better solution is to input 4 strings and then convert those strings to integers. If the conversion fails, simply ask for new input until the conversion succeeds. The following shows one method of achieving this: #include<iostream> #include<sstream> int main() { int n[4]; // repeat until valid bool valid {false}; while (!valid) { // create 4 temporary strings for input std::string s[4]; std::cout << "Enter 4 integers: " std::cin >> s[0] >> s[1] >> s[2] >> s[3]; // assume input is valid until proven otherwise valid = true; for (size_t i=0; valid && i<4; ++i) { // convert the current string to an integer std::stringstream ss {s[i]}; valid = (ss >> n[i]); } } // When we reach here, n[] will contain 4 valid integers. // Use n[] ... }


How many tokens are present in C?

There are 6 types of Tokens in C which are as follows:- 1. Keyword 2. Identifier 3. Constants/Literals 4. Variable 5. Operator 6. Punctuator


What is the function in java to find the size of given variable?

Dependion on the variable there are several methods to do it, this can only be applied to primitive types and arrays, for an array its the "name_of_array.length", for the arraylist this change just a little, it would be like "name_of_array_list.size()", for an int, double, float, long, byte, it would be like "name_of_variable.LENGTH" this is a public variable so you dont need a get, an finally for the String there is a method "name_of_string.length()" this would return the size of this String

Related Questions

What is the value of the discriminant for the equation 21 plus 33 plus 4?

There is no variable, and the equation is not valid.


Solve for the variable t plus 8 equals 4?

t=-4


What is z plus 37 equals 37 plus 4?

It is a linear equation in the variable z.


What is the constants of the expression -4 plus 11x plus 9 - 8x?

-4, 11, 9, and -8 are constants. 'x' is the variable.


What is the algebraic expresson for 2n plus 4?

The algebraic expression for "2n plus 4" is simply written as (2n + 4). Here, (n) represents a variable, and the expression combines the term (2n), which signifies two times the variable (n), with the constant (4).


How do you find the common ratio of 2 plus 4 plus 6 plus 8 plus 10.. is this valid?

No, there is no common ratio for the given number.


What is 2 plus variable a over 4 which equals negative 1?

this is not helpful


What are the 5 different types of karnaugh map?

The five different types of Karnaugh maps are 2-variable, 3-variable, 4-variable, 5-variable, and 6-variable maps. Each type corresponds to the number of variables involved in the Boolean functions being represented.


What is 4 plus x14?

It is 4 + 14x.It is conventional to write a combination of a number and variable with the number first.


What does the variable equal in -2(-7k plus 4) plus 9-13?

The given expression can be simplified to: 14k-12


What is p plus 4 equals 15?

It is a linear equation in one variable, p.


Are there any values of the variable A for which the expressions 2 plus A and 2A have the same value?

2. 2 plus 2 equals 4 and 2(2)= 4