2-6
C
/*E2-6*/
/*整数型データの入出力*/
#include <stdio.h>
int main()
{
int a,b,c,d;
printf("整数1は?\n");
scanf("%d",&a);
printf("%d\n",a);
printf("整数2は?\n");
scanf("%d",&b);
printf("%d\n",b);
printf("整数1と2は?\n");
scanf("%d,%d",&a,&b);
printf("%d,%d\n",a,b);
c=a*a+b*b;
d=a*a-b*b;
printf("2乗の和 = %d\n",c);
printf("2乗の差 = %d\n",d);
return 0;
}
Output
Embed on website
To embed this program on your website, copy the following code and paste it into your website's HTML:
Comments
This comment belongs to a banned user and is only visible to admins.
This comment belongs to a deleted user and is only visible to admins.