Problem No 1: Write a C++ program to prints the first n terms of the following Tick-Tock series. The value of n is taken as input. The first 8 terms of the Tick-Tock series, le. for n=8 are as follows: 25 +4 10 + 6 15 + 8 20
Answers
Answered by
0
Answer:
HOPE IT WILL HELP YOU BROTHER REALLY I THINK
Attachments:
Answered by
0
Answer:
#include <iostream>
using namespace std;
int main()
{
int a, b, n;
cout << "enter number of terms: ";
cin >> n;
a = 0;
b = 0;
while (n>0)
{
n -= 2;
a = a + 2;
b = b+5;
cout << a<<" ";
if (n >= 1 || n==0)
cout<<b << " ";
}
return 0;
}
Explanation:
Similar questions
Geography,
3 hours ago
Social Sciences,
6 hours ago
English,
6 hours ago
Computer Science,
8 months ago
Biology,
8 months ago