วันพฤหัสบดีที่ 13 ธันวาคม พ.ศ. 2555

                         คำสั่ง printf   

#include<stdio.h>
main()
{

    int a,b;
    float c;
    char sex[10];
     printf("Enter No>>>");
     scanf("%d",&a);
     printf("Enter Sex>>>");
     scanf("%s",sex);
     printf("Enter Age>>>");
     scanf("%d",&b);
     printf("Enter GPA>>>");
     scanf("%f",&c);
     printf("No is :%d Sex is :%s Age is :%d GPA is :%.2f",&a,sex,&b,&c);

}

ตัวแปร

                                 ตัวแปร
#include<stdio.h>
main()
{

    int x=24;
    float y=3.61;
     printf("Welcome to 401");
     printf(" my no is x=%d and",x);
     printf(" my grade is y=%.2f",y);
     printf(" Goodbye!!!");
}

วันพฤหัสบดีที่ 6 ธันวาคม พ.ศ. 2555