Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

ฟังก์ชัน Printf&scanf


Published on

Published in: Business, Technology
  • Be the first to comment

  • Be the first to like this

ฟังก์ชัน Printf&scanf

  1. 1. ˆ F printf( ) scanf( ) printf ( ) printf( F F, F F, F F,...) F F ˈ F F F F F ˈ F F F F F 14
  2. 2. F F ˆ F printf %d F F %o %x %u F%u F %e F F 2.13e45 %f %g %e %f F %c F F %s F 15
  3. 3. F F F F F ( F F ) F ʽ FF ʽ F ˈ F Note F F F F F % F 16
  4. 4. scanf ( ) scanf( F F , F F, F F,...) F F ˈ F F F ˈ F F ( ) F FF F ˈ F F ( ) F F F F F F F 2 F F F - F & F F F ˈ F F - F ˈ F F & F 17
  5. 5. F printf, scanf #include <stdio.h> main(){ int age; float height; char name[30];char name[30]; printf("Please enter your name, age and height: "); scanf("%s%d%f",&name, &age, &height); printf("Name: %s is %d years old",name,age); printf(" and tall %f cms.n",height); getch(); } 18