Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The code below declares three variables named x with types int, float, and doubl

ID: 674228 • Letter: T

Question

The code below declares three variables named x with types int, float, and double. On which line is each of the variable declared and used? int x; void ((float x) { float f = x; { double x; x = 3.4; } t= x+2; } int i = x; Write the output of the following program when it is executed #include float func(int i) { static float f = 10; f += i; return f. } int main() { printf(*func(5) = %f *. func(5). printf(*func(15) = %f *. func(15) return 0; Write a function with the function prototype int f(void); that prints out n methods, where n sequences the number of times it has been called. If it is called three times, for instance the output will be Test function by calling it five times Use a static variable inside the function. Use a global variable inside the function.

Explanation / Answer

4. The program to print the triangle :

class Traingle

{

public static void main(String args[])

{

int n,i;

for(i=1;i<=3;i++)

[

for(n=1;n<=i;n++)

{

System.out.println("*");

}

System.out.println(" ");

}

}

}