Answer: "World War-1: The War that Changed the Nation"
Answer:
#include <iostream>
using namespace std;
int main() {
int k;
double d;
string s;
cin >> k >> d >> s;
cout << s << " " << d << " " << k << "\n" << k << " " << d << " " << s; }
Explanation:
k is int type variable that stores integer values.
d is double type variable that stores real number.
s is string type variable that stores word.
cin statement is used to take input from user. cin takes an integer, a real number and a word from user. The user first enters an integer value, then a real number and then a small word as input.
cout statement is used to display the output on the screen. cout displays the value of k, d and s which entered by user.
First the values of k, d and s are displayed in reverse order. This means the word is displayed first, then the real number and then the integer separated again by EXACTLY one space from each other. " " used to represent a single space.
Then next line \n is used to produce a new line.
So in the next line values of k, d and s are displayed in original order (the integer , the real, and the word), separated again by EXACTLY one space from each other.
The program along with the output is attached.
Answer:
i think its C.
if its wrong i'm truly sorry
Explanation:
Answer:
The last character in the string processed is "t".
Explanation:
The index start from 0 and the len(fruit) is 5.
When index is 0 which is less than 5; "f" is printed
When index is 1 which is less than 5; "r" is printed
When index is 2 which is less than 5; "u" is printed
When index is 3 which is less than 5; "i" is printed
When index is 4 which is less than 5; "t" is printed
When index is 5, the condition is false; so the loop content is not executed.
Therefore, the last character traversed in the string "fruit" is "t".