[1.1] 誕生日等を入力するとお祝いが返ってくるプログラムの作成
[1.2]
#include<stdio.h>
main()
{
/*first name*/
char f[100];
/*secound name*/
char s[100];
/*month*/
char m[100];
/*day*/
int d[2];
printf("Input your first name:");
scanf("%s",f);
printf("Input your secound name:");
scanf("%s",s);
printf("month?");
scanf("%s",m);
printf("day?:");
scanf("%d",&d);
printf("Happy Birth Day to %s %s\n %s %d\n",f,s,m,d);
}
実行した結果、
Input your first name:a
Input your secound name:b
month?c
day?:5
Happy Birth Day to a b
c 6421996
[1.4] このようにdのところに入れた数字がうまく出力されません、どうしたらいいでしょうか
[2] 環境
[2.1] OS : Windows
[2.2] コンパイラ名 : gcc