Data Types, Variables and Input Output
Learn
Although there are many data types in c, for now you only need to learn a few. These are int, float, double, char, long long int. You can learn more about them from the following resources.
Link | Note |
---|---|
GeeksForGeeks | Skip void. |
Anisul Islam | Video number 13 to 32 |
Practice
Try to solve the following problems. If you face difficulties or this is your first time solving problem on an online platform please refer here at first. Then if you can't solve it after trying for some time you can see the solution. But try first. Otherwise it won't be beneficial for you.
Problem Link | Hint/Note | Solution |
---|---|---|
Basic Data Types | The description has c++ codes. Don't worry. The Input section stated that Only one line containing the following space-separated values: int, long long, char, float and double respectively. This indicates you need to have 5 variables of type int, long long, char, float and double. You need to read them. And then print them accordingly. To print them in new line you need to use "\n" escape sequence. And remember to not print any extra space. Due to precision given in the sample output you need to print the floating point number using %0.2f and the double using %0.1f. | |
a | v | c |
- | - | - |
a | v | c |