1、
#include<stdio.h>
int main (void){
int dogs;
printf("How many dogs do you have?\n");
scanf("%d",&dogs);
printf("So you have %d dog(s)!\n",dogs);
return 0;
}
2、
#include <stdio.h>
void butler(void);
int main(void)
{
printf("I will summon the butler function.\n");
butler();
printf("Yes.Bring me some tea and writeable CD-ROMS.\n");
return 0;
}
void butler(void) //函数定义的开始
{
printf("You rang,sir?\n");
}
3、
#include <stdio.h>
int main(void)
{
char ch;
printf("Please enter a character.\n");
scanf("%c",&ch);
printf("The code for %c is %d.\n",ch,ch);
return 0;
}
4、
#include <stdio.h>
int main(void)
{
unsigned int un=3000000000;
short end=200;
long big=65537;long long verybig=12345678908642;
printf("un=%u and not %d\n",un,un);
printf("end=%hd and %d\n",end,end);
printf("big=%1d and not %hd\n",big,big);
return 0;
}