Write a java program to print 20 terms of series 3n+2.Stop as 'soon as multiple of 4 is encountered
Share
Write a java program to print 20 terms of series 3n+2.Stop as 'soon as multiple of 4 is encountered
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Answer:
// Java Program to print an arithmetic
// progression series
class GFG
{
static void printAP(int a, int d, int n)
{
// Printing AP by simply adding d
// to previous term.
int curr_term;
curr_term=a;
for (int i = 1; i <= n; i++)
{ System.out.print(curr_term + " ");
curr_term =curr_term + d;
}
}
// Driver code
public static void main(String[] args)
{
// starting number
int a = 2;
// Common difference
int d = 1;
// N th term to be find
int n = 5;
printAP(a, d, n);
}
}
Answer:
꧁༒ÂⱠÊӾ ᴳᵒᵈ༒꧂
⌛⏳FOLLOW ME BHAI.. TRYING TO COMPLETE 1000 ANSWERS...
[tex]<body bgcolor=yellow><maruee><fontcolor=blue>[/tex]
See the attachment for detailed solution to the question ❤❤..
#TRUE BRAINLIAN#BE BRAINLY♻️
❌✖️FREE FORM SPAM✖️❌
✔️MARK MY ANSWERS BRAINLIEST PLEASE..
HOPE IT HELPS..