हिंदी

Convert the given loop into exit controlled loop. int a,b; for ( a=10 ,b=1; a>=1 ;a-=2) { b+=a; b++; } System.out.print(b); - Computer Applications

Advertisements
Advertisements

प्रश्न

Convert the given loop into exit controlled loop.

int a,b;
for ( a=10,b=1; a>=1 ;a-=2)
{
b+=a;
b++;
}
System.out.print(b);
कोड लेखन
Advertisements

उत्तर

int a,b;
a=10;
b=1;
do
{
b+=a;
b++;
a-=2;
} while(a>=1);
System.out.print(b);
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2024-2025 (March) Official Board
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×