Programming II Written Assignment 2
Programming II Written Assignment 2
c. showNum(45.67); ________________________________
2. What will the output of the following program be if the user enters 10
{ {
} func2();
void func2() }
{ else
} func2();
{ }
int input; }
3. What is the output of the following program?
#include <iostream> cout << “x= “<<x<< " " << “y=” <<y<< endl;
int main() {
{ cout << “a=” <<a<< " " <<” b=” <<b<< endl;
cout << “x=” <<x<< " " <<” y=” << y<<endl; cout << “a=” <<a<< " " <<” b=” <<b<< endl;
func1(x, y); }
4. Write a function, named fiveTime, that accepts an integer argument. When the function is called, it
should display the product of its argument multiplied times 5.
5. Write a function named factorial of integer return type which accepts integer argument. The function
prompts the user to enter integer & calculate & display the factorial of the number.
6. Write a function named dailytem, which accept the daily temperature of welkite as an integer
argument. The function should prompt the user to enter the daily temperature of welkite and the
function decides whether the daily temperature of the welkite as cold, moderat , hot or unexpected
weather based on the daily temperature range given below.
1oc - 15oc cold