Page 1 :
Thursday, June 17, 2021, 8:04 PM, , COMBINED ICSE 246 Page 1
Page 9 :
class table, {, int i,t;, void main(int n), {, for(i=1;i<=10;i++), {, t=n*i;, System.out.println(n+"*"+i+"="+t);, }, }, }, , COMBINED ICSE 246 Page 9
Page 10 :
class sumfact, {, int i,s=0;, void main(int n), {, for(i=1;i<=n;i++), {, if(n%i==0), s=s+i; //accumulator, }, System.out.println("Sum of factors="+s);, }, }, , COMBINED ICSE 246 Page 10
Page 11 :
class amicable, {, int i,s1=0,s2=0;, void main(int a, int b), {, for(i=1;i<a;i++), {, if(a%i==0), s1=s1+i;, }, for(i=1;i<b;i++), {, if(b%i==0), s2=s2+i;, }, if(s1==b && s2==a), System.out.println("Amicable numbers");, else, System.out.println("Not Amicable numbers");, }, }, , COMBINED ICSE 246 Page 11
Page 12 :
import java.util.*;, class prime, {, public static void main(), {, Scanner sc=new Scanner(System.in);, int i,c=0,n;, System.out.println("Enter a number");, n=sc.nextInt();, for(i=1;i<=n;i++), {, if(n%i==0), c++;, }, if(c==2), System.out.println(n+" is a prime number");, else if(c>2), System.out.println(n+" is a composite number");, else, System.out.println(n+" is neither prime nor composite");, }, }, , COMBINED ICSE 246 Page 12
Page 13 :
The production (P) of crude oil of a country in millions of barrels may estimate by the, following set of equations, where t represents the time in years:, P =5+3t,, , 0<t<5, , P =14+ (t-5/2)3, , t>=5, , Write a program to find the production for every year from t= 1 to n where n is input by user., , class crude, {, int t;, double p;, void main(int n), {, for(t=1;t<=n;t++), {, if(t>0 && t<5), p=5+3*t;, else, p=14+Math.pow((t-5/2.0),3);, System.out.println("Production for "+t+" year is "+p);, }, }, }, , COMBINED ICSE 246 Page 13
Page 19 :
class seriesfact, {, int i,j,f,f1;, double s=0.0;, void main(int n), {, for(i=1;i<=n;i++), {, f=1;, for(j=1;j<=i;j++), f=f*j;, f1=1;, for(j=1;j<=i*i;j++), f1=f1*j;, s=s+(double)f/f1;, }, System.out.println("Sum ="+s);, }, }, , COMBINED ICSE 246 Page 19