দুটি সংখ্যার যোগফল ও গড় নির্ণয়ের জন্য সি ভাষায় প্রোগ্রাম।
#include<conio.h>
void main()
{
int x,y,sum,avg;
clrscr();
printf("Enter the first number:");
scanf("%d",&x);
printf("Enter the second number:");
scanf("%d",&y);
sum=x+y;
avg=sum/2;
printf("sum=%d\n",sum);
printf("avg=%d\n",avg)
getch();
}
Output:
Enter the first number: 8
Enter the second number: 2
Sum=10
Avg=5
Copy This Code:
Avg=5
Copy This Code:
Comments
Post a Comment