Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int n,sum=0;
- float avg;
- printf("Input the 2numbers : \n");
- int i=1;
- while (i<=2)
- {
- printf("Number-%d :",i);
- i++;
- scanf("%d",&n);
- sum +=n;
- }
- avg=sum/2.0;
- printf("The sum of 2 numbers is : %d\nThe Average is : %f\n",sum,avg);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement