Explanation:
Answer in the attached image...
hope it helps
Answer:
2. int i; for (i = 0; i <= arr.length; i++) { System.out.println(arr[i]); }
3. for (int i : arr) { System.out.println(i); }
second and third code segments print the same output.
Explanation:
In first code segment, while loop starts printing from arr[0] and it continues till the second last element of the the array as in statement of while loop i<arr.length. Which print till arr[length - 1].
In second code, for loop starts from 0 and ends at the last element of the array. which prints from arr[0] to arr[length].
In third code segment, it also print from arr[0] to arr[length]. In this case for (int i : arr) means start from first value of array and continues till last element of the array.
Answer:
#include <stdio.h>
int main()
{
//Store temp in Fahrenheit
int temp_fahrenheit;
//store temp in Celsius
float temp_celsius;
printf("\nTemperature conversion from Fahrenheit to Celsius is given below: \n\n");
printf("\n%10s\t%12s\n\n", "Fahrenheit", "Celsius");
//For loop to convert
temp_fahrenheit=0;
while(temp_fahrenheit <= 212)
{
temp_celsius = 5.0 / 9.0 *(temp_fahrenheit - 32);
printf("%10d\t%12.3f\n", temp_fahrenheit, temp_celsius);
temp_fahrenheit++;
}
return 0;
}
Explanation:
The program above used a while loop for its implementation.
It is a temperature conversion program that converts integer Fahrenheit temperatures from 0 to 212 degrees to floating-point Celsius temperatures with 3 digits of precision.
This can be calculated or the calculation was Perform using the formula celsius = 5.0 / 9.0 * ( fahrenheit - 32 ).
The expected output was later printed in two right-justified columns of 10 characters each, and the Celsius temperatures was preceded by a sign for both positive and negative values.
Answer:
here is ur answer
Explanation:
Fugaku
the japaness supercomputer , fugaku is the world most powerfull computer!