#include<stdio.h>
int main(void)
{
printf("Hello World!");
return 0;
}
#include <stdio.h>
void main()
{
int a = 1;
float b = 2.5;
char c = 'A';
printf("a = %d\n", a);
printf("b = %f\n", b);
printf("c = %c\n", c);
printf("End of program\n");
}
#include <stdio.h>
main()
{
printf("Data type Number of bytes\n");
printf ("----------------- -----------------\n");
printf ("char %d\n", sizeof (char));
printf("int %d\n", sizeof(int));
printf("short int %d\n", sizeof (short));
printf("long int %d\n",sizeof (long));
printf("float %d\n", sizeof(float));
printf ("double %d\n",sizeof (double));
}
#include <stdio.h>
int main()
{
double temC, temF; //存储摄氏度和华氏度
temF=100;
temC=5*(temF-32)/9;
printf("华氏温度%5.2f对应的摄氏温度是%5.2f\n,temF,temC");//% m.nf中m代表输出数长,n代表小数点后的数长 小数点也算一个数位,
return 0;
}
#include <stdio.h>
int main()
{
int a=6,b=5,c=5;
int triC;
triC=a+b+c;
printf("三角形的周长是:%d\n",triC);
return 0;
}