Sheet-2 For
Sheet-2 For
*
**
***
****
*****
*****
****
***
**
*
a) Sum the odd integers between 1 and 99 using a for statement. Use the unsigned integer variables
sum and count.
b) Print the value 333.546372 in a field width of 15 characters with precisions of 1, 2, 3, 4 and 5.
Left justify the output. What are the five values that print?
c) Calculate the value of 2.5 raised to the power of 3 using the pow function. Print the re sult with
a precision of 2 in a field width of 10 positions. What is the value that prints?
Fayoum International Technological University
Faculty of Technology Information Communication Technology Program
Third Year – Advanced in C programming
Academic Year (2024/2025) Dr. Esraa El Hariri
JD-DEM: Abdullah Emam
a) Counter-controlled iteration is also known as……………….. iteration because it’s known in advance how
many times the loop will be executed.
b) Sentinel-controlled iteration is also known as ………………..iteration because it’s not known in advance
how many times the loop will be executed.
c) In counter-controlled iteration, a(n)……………….. is used to count the number of times a group of
instructions should be repeated.
d) The ……………..statement, when executed in an iteration statement, causes the next iteration of the
loop to be performed immediately.
e) The ……………..statement, when executed in an iteration statement or a switch, causes an immediate
exit from the statement.
f) The …………….. is used to test a particular variable or expression for each of the constant integral
values it may assume.
State whether the following are true or false. If the answer is false, explain why.