Recap - Initialize Variables
Part of the Fundamentals section of Coddy's C++ journey — lesson 13 of 74.
Challenge
BeginnerWrite a C++ code that initializes the following variables:
kwith the value88PIwith the value3.14namewith the value"bob"
Make sure you use the exact variables names and values. Remember, C++ is case sensitive!
Try it yourself
#include <iostream>
#include <string>
int main() {
// Type your code below
// Don't change the lines below
std::cout << "k = " << k << std::endl;
std::cout << "PI = " << PI << std::endl;
std::cout << "name = " << name << std::endl;
return 0;
}All lessons in Fundamentals
4Operators Part 1
Arithmetic OperatorsModulo OperatorIncrement/DecrementPost Increment/DecrementArithmetic ShortcutsComparison OperatorsString Comparison3Variables Part 2
Type DeclarationNaming ConventionsRecap - Initialize VariablesType Casting Part 1Type Casting Part 26Decision Making
If StatementIf - ElseSwitch StatementConditional OperatorRecap - If ElseNested If - Else