Ask your own question, for FREE!
Computer Science 17 Online
Ballery1:

How may the double variables temp, weight, and age be defined in one statement? The data type double is used to define variables that can hold real numbers. The syntax to declare a variable of double data type is as follows: Double var_name The double data type variables can be declared using a single statement or multiple statements. The declaration of double data type variables named temp, weight, and age in a single statement is as follows: Double temp, weight, age; The following example code helps to understand the declaration of double data types in a single statement #include Using namespace std; Isn’t main () { //declare the variables with double data type Double temp, weight,age; Return 0; }

imqwerty:

okay?

Ballery1:

Int main()******

Ballery1:

Is the rest of the answer correct?

imqwerty:

no

imqwerty:

switch off the autocorrect

imqwerty:

*using *double *return

imqwerty:

``` The data type double is used to define variables that can hold real numbers. The syntax to declare a variable of double data type is as follows: Double var_name ``` you forgot the semicolon in your syntax

imqwerty:

\(\color{#0cbb34}{\text{Originally Posted by}}\) @Ballery1 Int main()****** \(\color{#0cbb34}{\text{End of Quote}}\) int

imqwerty:

it's not case insensitive

Ballery1:

Yes i meant int main ()

Ballery1:

Apart from the spelling and case sensitivity, everything else is correct ?

imqwerty:

yup

Ballery1:

Ok so I’m getting an error when i declare the double datatype variable. It doesn’t recognize the Double temp,weight,age; Command

imqwerty:

because *double

imqwerty:

\(\color{#0cbb34}{\text{Originally Posted by}}\) @imqwerty *using *double *return \(\color{#0cbb34}{\text{End of Quote}}\) .

Ballery1:

I changed that to double temp,weight,age now but it still doesn’t recognize the thing

imqwerty:

can you share the code

Ballery1:

``` #include <iostream> using namespace std; int main() { //declare the variables with double data type double temp,weight,age; return 0; } ```

imqwerty:

That looks fine, what error does it throw?

Ballery1:

It doesn’t show any errors but it also doesn’t produce any result

Ballery1:

Is this program suppose to produce anything ?

imqwerty:

it'll produce an executable file after compilation(which all programs do), but when you run that executable you won't get any visible output because you're not outputting anything, there's no cout

Ballery1:

Ooooooo icy now. Thanks qwerty

Ballery1:

Congrats India beat Pakistan in cricket yesterday

Ballery1:

I’m happy for ur team, they worked hard to earn that victory. Big congrats to them

imqwerty:

I saw the highlights, the boys played well indeed cx

imqwerty:

np

Ballery1:

K tc

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!