Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Write down the output of the following programs. a) #include float avg (float, float); int main() float yi, y2, average; yl=5.0; y2=7.0; average =
1. Write down the output of the following programs. a) #include float avg (float, float); int main() float yi, y2, average; yl=5.0; y2=7.0; average = avg_yi, y2); printf("y1 = tf y2=3f The average is= $f", yi, y2, average); return 0; } float avgffloat xl, float x2) E float result; result = (x1+x2)/2; return result; Page 1 b) #include float square float x); void main 4 float mini printf " Enter some number for finding square "); scant "$", am ) ; n = square m); printf _ Square of the given number $f is then ); } float square float x) float pi return } #include void swap (int a, int b); int main() int m = 22, n = 44; printf(" values before swap $d hand n - $d", m, n); swap (m, n) ; } m = void swap(int a, int b) int tup SHB = a; a = b; b = t; printf(" \oxalues after swap m = $d and n = $d", a, b); d) lage 2 #include int fint a) I return a$2? ++a i a--; void main() E int i, a = 2; for (i = 0; i
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started