मराठी

Write the programs in Java to display the first ten terms of the following series: 0, 3, 8, 15, ................... - Computer Applications

Advertisements
Advertisements

प्रश्न

Write the program in Java to display the first ten terms of the following series:

0, 3, 8, 15, ...................

थोडक्यात उत्तर

उत्तर

public class Q1c
{ public static void main(String args[]) 
{ int x = 0, y = 1, i;
for (i = 1; i <= 10; i++)
{ System.out.print(x + " ");
y = y + 2; 
x = x + y;
}
}}
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 1.09: Iterative Constructs in Java - EXERCISES [पृष्ठ १२४]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
पाठ 1.09 Iterative Constructs in Java
EXERCISES | Q VI. 1. (c) | पृष्ठ १२४
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×
Our website is made possible by ad-free subscriptions or displaying online advertisements to our visitors.
If you don't like ads you can support us by buying an ad-free subscription or please consider supporting us by disabling your ad blocker. Thank you.