import java.util.*;
public class Main
{
public static void main ( String[] args )
{
int a=1,b=1;
for ( a = 2;a <= 8;a += 3 )
{
for ( b = a;b <= 8;b += 3 )
{
System.out.print ( "\t" + b );
}
System.out.println ( );
}
}
}
public class Main
{
public static void main ( String[] args )
{
int a=1,b=1;
for ( a = 2;a <= 8;a += 3 )
{
for ( b = a;b <= 8;b += 3 )
{
System.out.print ( "\t" + b );
}
System.out.println ( );
}
}
}
1/1! + 2/2! + 3/3! + 4/4! +…….+ n/n!
أوجد مجموع المتسلسله الحسابيه
أوجد مجموع المتسلسله الحسابيه
import java.util.*;
public class Main
{
public static void main ( String[] args )
{
Scanner input = new Scanner ( System.in );
System.out.print ( "Enter n value: " );
double n= input.nextDouble ( );
double f = 1;
double S = 0;
for ( int i = 1; i <= n; i++ )
{
f = f * i;
System.out.println ( " factorial is : " + f );
S += ( i / f );
System.out.println ( "sum of factorial is : " + S );
}}}
public class Main
{
public static void main ( String[] args )
{
Scanner input = new Scanner ( System.in );
System.out.print ( "Enter n value: " );
double n= input.nextDouble ( );
double f = 1;
double S = 0;
for ( int i = 1; i <= n; i++ )
{
f = f * i;
System.out.println ( " factorial is : " + f );
S += ( i / f );
System.out.println ( "sum of factorial is : " + S );
}}}
باستخدام for loop أوجد قيمة x
اذا علمت ان :
x = 1!+3!+5!+7!
اذا علمت ان :
x = 1!+3!+5!+7!
import java.util.*;
public class Main
{
public static void main ( String[] args )
{
int f = 1, Sum = 0;
for ( int i = 1; i <= 7; i++ )
{
if ( i % 2 != 0 )
{
f = f * i;
Sum += f;
System.out.println ( "sum of factorial is : " + Sum );
}
}
// System.out.println ( "sum of factorial is : " + Sum );
}}
public class Main
{
public static void main ( String[] args )
{
int f = 1, Sum = 0;
for ( int i = 1; i <= 7; i++ )
{
if ( i % 2 != 0 )
{
f = f * i;
Sum += f;
System.out.println ( "sum of factorial is : " + Sum );
}
}
// System.out.println ( "sum of factorial is : " + Sum );
}}
الواجب ----السؤال الأول- ------- 01-12-2022 👇
💻💻💻💻💻💻💻💻💻💻💻💻
اكتب برنامج لحساب قيمة z
حيث
z=x^n/n!
ثم تابع سير البرنامج يدويا بالتفصيل
💻💻💻💻💻💻💻💻💻💻💻💻
اكتب برنامج لحساب قيمة z
حيث
z=x^n/n!
ثم تابع سير البرنامج يدويا بالتفصيل
الواجب ----السؤال الثاني-------- 01-12-2022 👇
💻💻💻💻💻💻💻💻💻💻💻💻
اكتب برنامج لحساب قيمة X
حيث
X=a/1! + x^2 / 2! + x^3 / 3!
ثم تابع سير البرنامج يدويا بالتفصيل
💻💻💻💻💻💻💻💻💻💻💻💻
اكتب برنامج لحساب قيمة X
حيث
X=a/1! + x^2 / 2! + x^3 / 3!
ثم تابع سير البرنامج يدويا بالتفصيل
كون مصفوفه تحتوي على 7 قيم ثم اطبع كل قيمه مع الموقع المقابل لها
import java.util.*;
public class Main
{
public static void main(String[] args)
{
Integer []a = new Integer[] {9,8,7,6,5,4,3};
for (int i= 0;i<7;i++)
{
System.out.println("a["+i+"]= "+ a[i]);
}
}
}
public class Main
{
public static void main(String[] args)
{
Integer []a = new Integer[] {9,8,7,6,5,4,3};
for (int i= 0;i<7;i++)
{
System.out.println("a["+i+"]= "+ a[i]);
}
}
}
السؤال الثاني
كون مصفوفه تحتوي على 7 قيم ثم اطبع القيم الفرديه مع المواقع المقابله لها
كون مصفوفه تحتوي على 7 قيم ثم اطبع القيم الفرديه مع المواقع المقابله لها
import java.util.*;
public class Main
{
public static void main(String[] args)
{
Integer []a = new Integer[] {9,8,7,6,5,4,3};
for (int i= 0;i<7;i++)
{
if(i%2!=0)
{
System.out.println("a["+i+"]= "+ a[i]);
}
}
}
}
public class Main
{
public static void main(String[] args)
{
Integer []a = new Integer[] {9,8,7,6,5,4,3};
for (int i= 0;i<7;i++)
{
if(i%2!=0)
{
System.out.println("a["+i+"]= "+ a[i]);
}
}
}
}
السؤال الثالث
كون مصفوفه تحتوي على 7 قيم ثم اطبع كل الموقع فقط بدون القيم
كون مصفوفه تحتوي على 7 قيم ثم اطبع كل الموقع فقط بدون القيم