Write a program in C to display the 1st 10 terms of the series using for loop:
3, 6, 12, 24
Answers
Answered by
2
The given code is written in C.
#include <stdio.h>
int main() {
for(int i=1,a=3;i<=10;i++,a*=2)
printf("%d ",a);
return 0;
}
- Initialise a = 3.
- Repeat i = 1 to 10
- Display the value of a.
- a = a * 2
See the attachment for output.
Attachments:
Similar questions
English,
6 days ago
Math,
6 days ago
Math,
12 days ago
Biology,
12 days ago
Environmental Sciences,
7 months ago
India Languages,
7 months ago