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
okay?
Int main()******
Is the rest of the answer correct?
no
switch off the autocorrect
*using *double *return
``` 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
\(\color{#0cbb34}{\text{Originally Posted by}}\) @Ballery1 Int main()****** \(\color{#0cbb34}{\text{End of Quote}}\) int
it's not case insensitive
Yes i meant int main ()
Apart from the spelling and case sensitivity, everything else is correct ?
yup
Ok so I’m getting an error when i declare the double datatype variable. It doesn’t recognize the Double temp,weight,age; Command
because *double
\(\color{#0cbb34}{\text{Originally Posted by}}\) @imqwerty *using *double *return \(\color{#0cbb34}{\text{End of Quote}}\) .
I changed that to double temp,weight,age now but it still doesn’t recognize the thing
can you share the code
``` #include <iostream> using namespace std; int main() { //declare the variables with double data type double temp,weight,age; return 0; } ```
That looks fine, what error does it throw?
It doesn’t show any errors but it also doesn’t produce any result
Is this program suppose to produce anything ?
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
Ooooooo icy now. Thanks qwerty
Congrats India beat Pakistan in cricket yesterday
I’m happy for ur team, they worked hard to earn that victory. Big congrats to them
I saw the highlights, the boys played well indeed cx
np
K tc
Join our real-time social learning platform and learn together with your friends!