Working with Data Types is very important in the programming world. Here, we will learn to manipulate the basic data types in CPP.
You will be given four different variables of different data types: a (int), b (float), c (double), l (long long), d (string). Your task is to do step-wise operations as given below:
1. Divide b by c.
2. Divide b by a.
3. Divide c by a (cast to int).
4. Add result of step 3 with l.
5. Print the given string, and the 4th (0-based indexing) character of the string both separated by a space.
First line of input conatins number of testcases T. T testcases follow. For each testcase, there will be two lines of input. First line contains a, b, c, and l. Next line contains the string (single word).
For each testcase, in a new line, print the required output as directed in steps.
Don't worry about the taking input or testcases. Just complete the function dataTypes(int a, float b, double c, long long l,string d)
1 <= T <= 10
1 <= a, b, c <= 106
1 <= l <= 1018
1 2 3 5
0.666667 2 3 8
Testcase 1: a=1, b=2, c=3, l=5, d=gfgc
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.