Professional Documents
Culture Documents
Tutorial-4 (Functions)
1. Find the output of following program.
#include<stdio.h>
int fun(int a, int b)
{
int a=0;
a=a+b;
b=a-b;
a=a-b;
return a;
}
int main()
{
int a=10, b=20 , c;
c = fun(b,a);
printf(“%d”,c);
return 0;
}
Hint:-
Output: Error (‘a’ re-declared as different kind of symbol.)
9. Given the size of float is 4, Find the output of the following program.
#include<stdio.h>
int returns(int returns)
{
returns+=5.60;
return(returns);
}
int main()
{
int n=returns(sizeof(float));
printf(“%d”, n);
return 0; }
Hint:- Use the concept of call by value.
Output: 9