รูปแบบคำสั่ง

#include "stdio.h"
#include "conio.h"
void main()
{
int a,b,c;
clrscr();
printf("Enter three integer numbers : ");
scanf("%d%d%d",&a,&b,&c);
printf("a = %d b = %d c = %d \n",a,b,c);
}
เป็นการป้อนเลขจำนวนเต็ม 3 ตัวให้กับตัวแปร a,b และ c ในการป้อนตัวเลขให้เว้น ช่องว่างระหว่างตัวเลขแต่ละชุดซึ่ง scanf() จะข้อมช่องว่างไปจนกระทั่งพบตัวเลขจึงจะอ่านข้อมูลอีกครั้ง
2. ฟังก์ชั่น printf() เป็นฟังก์ชั่นใช้ พิมพ์ค่าข้อมูลไปยังหน้าจอคอมพิวเตอร์

%d แทนเลขจำนวนเต็ม
%e แทนเลขในรูปเอกซ์โพเนนเชียล (exponential form)
%f แทนเลขทศนิยม
%0 แทนเลขฐานแปด
%s แทนสตริงก์
%u แทนเลขจำนวนเต็มไม่คิดเครื่องหมาย
%x แทนเลขฐานสิบหก
%p แทนข้อมูลแบบพอยน์เตอร์ (pointer)
%% แทนเครื่องหมาย %
สำหรับข้อมูลชนิดทศนิยมจะมีโมดิฟายเออร์ l และ L โดย l จะหมายถึงข้อมูลชนิดเลขจำนวนจริงละเอียด 2 เท่า ส่วน L จะหมายถึงข้อมูลชนิดเลขจำนวนจริงรายละเอียด 2 เท่า เช่น %lf หมายถึงข้อมูลชนิดเลขจำนวนจริงละเอียด 2 เท่า
ตัวอย่าง
#include
#include
void main(void)
{
int n;
clrscr();
n=100;
getch();
}
3. ฟังก์ชัน getchar() ฟังก์ชัน getchar() ใช้สำหรับป้อนตัวอักษรผ่านทางแป้นพิมพ์โดยจะรับตัวอักษรเพียง 1 ตัวเท่านั้น และแสดงตัวอักษรบนจอภาพ
รูปแบบคำสั่ง

ตัวอย่าง
#include
void main()
{
char ch;
printf("Type one character ");
ch = getchar();
printf("The character you type is %c \n",ch);
printf("The character you typed is ");
putchar(ch);
}
การใช้ฟังก์ชัน putchar() แทน printf() จะพิมพ์ตัวอักษร 1 ตัว และเคอร์เซอร์จะไม่ขึ้นบรรทัดใหม่
4. คำสั่ง getche(); และ getch();
คำสั่ง getche(); จะรับตัวอักษร 1 ตัวที่ป้อนทางแป้นพิมพ์

ch หมายถึง ตัวแปรชนิดตัวอักษร
#include "stdio.h"
#include "conio.h"
void main(void)
{
char answer;
clrscr();
printf("Enter A Character : ");
printf("\n");
printf("A Character is : %c\n",answer);
getch();
}

ตัวอย่าง คำสั่ง getch();
#include
#include
void main(void)
{
char answer;
clrscr();
printf("Enter A Character : ");
answer=getch();
printf("\n");
printf("A Character is : ");
putchar(answer);
getch();
}
5. ฟังก์ชัน gets() ฟังก์ชัน gets() ใช้สำหรับข้อมูลชนิดสตริงก์หรือข้อความซึ่งป้อนทางแป้นพิมพ์
รูปแบบคำสั่ง

ตัวอย่าง
main()
{
char message[50];
printf(“ Enter a message(less than 49 characters)\n”);
gets(message);
printf(“ The message you entered is %s\n”,message);
}