กิจกรรมที่ 1 ภาษาซีเบื้องต้น

ตัวอย่างโปรแกรม 1

#include <stdio.h>

main()

{

printf("Hello world");

}

ตัวอย่างโปรแกรม 2

#include <stdio.h>

main()

{

char name[15];

printf("Enter your name ==>");

scanf("%s",&name);

printf("Hello %s",name);

}

ตัวอย่างโปรแกรม 3

#include<stdio.h>

main()

{

int age = 20;

char sex = 'f';

float grade = 3.14;

char name[10] = "malee";

printf("You are %s\n",name);

printf("You are %c\n",sex);

printf("You are %d years old\n",age);

printf("You grade is %f\n",grade);

}