# data[].attributes.body
int main()

{

float rate = 0.0;

float consumption = 0.0;

float cost = 0.0;

printf("Electricity rate per kilowatt hour? :");

scanf("%f", &rate);

printf("Amount of electricity used (kilowatt hour unit) : ");

scanf("%f",&consumption);

cost = rate * consumption;

printf("Electricity bill: %.2f THB\n", cost);

return 0;

}

# data[].attributes.body
#include <stdio.h>
#include <conio.h>
int main()    {
int Watt;
float Hours,Power,Unit,Payment;
printf("Program of Calculation your Electric\n");
printf("----------------------------------------------------------\n");
printf("Enter Watt:  ");
scanf ("%d",&Watt);
printf("Enter Hours:  ");
scanf("%f",&Hours);
Power = Watt*Hours;
Unit = Power/1000;
Payment = Unit*3.99;
printf("Your payment of electric is: %.2f\n",Payment);
getch();
}

# data[].attributes.body
#include<stdio.h>

#include<conio.h>

int main()

{

int points;

printf("How many points can you score?: ");

scanf("%d",&points);

if(points>=50){

printf("You have a score of more than 50\n");

printf("pass exam...Congretulations\n");

}

else

{

printf("Fail...Attempt again\n");

}

printf("Your score = %d\n",points);

printf("Bye bye...see you again next semester \n");

getch();

return(0);

}

# data[].attributes.body
#include<stdio.h>

#include<conio.h>

int main()

{

int sum = 1;

int fac, count = 1;

printf("Please enter number of factorial : ");

scanf("%d", &fac);

while (count<=fac)

{

sum = sum*count;

count = count + 1;

}

printf("Result of %d! is %d",fac,sum);

getch();

}

# data[].attributes.body
#include<stdio.h>

#include<conio.h>

int main()

{

int month;

printf("Enter Your Month : (1-12) ");

scanf("%d",&month);

switch (month)

{

case 1 :

printf("January \n");

printf("Happy New Year \n");

printf("Children’s Day \n");

break;

case 2 :

printf("February \n");

printf("Chinese New Year’s Day \n");

printf("Valentine’s Day \n");

break;

case 3 :

printf("March \n");

printf("Thai Elephant Day \n");

printf("National Cereal Day \n");

break;

case 4 :

printf("April \n");

printf("Thai Heritage Conservation Day \n");

printf("Songkran Festival Day \n");

break;

case 5 :

printf("May \n");

printf("National Labour Day \n");

printf("National Tree Day \n");

break;

case 6 :

printf("June \n");

printf("World Environment Day \n");

printf("Sunthornphu Day /Soonthornphu Day \n");

break;

case 7 :

printf("July \n");

printf("Asarnha Bucha Day \n");

printf("Buddhist Lent Day \n");

break;

case 8 :

printf("August \n");

printf("Thai Peace Day \n");

printf("Chinese Ghost Festival \n");

break;

case 9 :

printf("September \n");

printf("Moon Festival/Moon Day \n");

printf("Thai Ghost Festival \n");

break;

case 10 :

printf("October \n");

printf("Innovation Day \n");

printf("Thai Technology Day \n");

break;

case 11 :

printf("November \n");

printf("Loy Krathong Day \n");

printf("Navy Day \n");

break;

case 12 :

printf("December \n");

printf("National Sport’s Day \n");

printf("Nation Wildlife Protection Day \n");

break;

default :

printf("Error \n");

printf("Please enter Numer (1-12) only, Thank you \n");

}

getch();

}

# data[].attributes.body
#include<stdio.h>

#include<conio.h>

int main()

{

float score;

float grade;

printf("Input Your Score : ");

scanf("%f",&score);

if (score>=80)

grade= 4;

else if (score>=75)

grade=3.5;

else if (score>=70)

grade=3;

else if (score>=65)

grade=2.5;

else if (score>=60)

grade=2;

else if (score>=55)

grade=1.5;

else if (score>=50)

grade=1;

else

grade=0;

printf("Your's Score = %.2f \n",score);

printf("Grade = %.1f ",grade);

getch();

}

# data[].attributes.body
#include<stdio.h>
#include<conio.h>
int main()
{
float score;
char grade;
printf("Input Your Score : ");
scanf("%f",&score);
if (score>=80)
grade= 'A';
else if (score>=70)
grade='B';
else if (score>=60)
grade='C';
else if (score>=50)
grade='D';
else
grade='F';
printf("Your's Score = %.2f \n",score);
printf("Grade = %c ",grade);
getch();
}