write a program to display the result of the following summation

  • 2021-02-12

توصيف

write a program to display the result of the following summation:

 1+2+3+4+5+6+7+8+9

=====================================

solution:

int summation=0;
for(int i =1;i<=9;i++)
{
	summation=summation+i;
}
System.out.println("result of summation is "+summation);

هل كان المحتوى مفيد؟

التعليقات

لاضافة سؤال أو تعليق على المشاركة يتوجب عليك تسجيل الدخول
تسجيل الدخول
محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...