Answered step by step
Verified Expert Solution
Link Copied!

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 =

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions