# 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();
}

# 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.headline
นางสาวภาวนา รุณณี ม.5/5 เลขที่18

# data[].attributes.subject
นางสาวภาวนา รุณณี ม.5/5 เลขที่18

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

#include <conio.h>

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: %.4f\n",Payment);

getch();

}

# data[].attributes.headline
นางสาวภาวนา รุณณี เลขที่18 ม.5/5

# data[].attributes.subject
นางสาวภาวนา รุณณี เลขที่18 ม.5/5

# data[].attributes.body
ขนาด 2000 w

ค่าไฟ 7.9800 Baht/hr

# data[].attributes.headline
นางสาวภาวนา รุณณี ม.5/5 เลขที่ 18

# data[].attributes.subject
นางสาวภาวนา รุณณี ม.5/5 เลขที่ 18

# 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()

{

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()

{

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("Febuary \n");

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

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

break;

case 3 :

printf("March \n");

printf("International Day of Happiness - 20 March \n");

printf("National Doctors Day - March 30 \n");

break;

case 4 :

printf("April \n");

printf("World Health Day - 7 April \n");

printf("Earth Day - 22 April \n");

break;

case 5 :

printf("May \n");

printf("Labor Day - 1 May \n");

printf("World Press Freedom Day - 3 May \n");

break;

case 6 :

printf("June \n");

printf("International Somtam Day - 2 June \n");

printf("World Environment Day - 5 June \n");

break;

case 7 :

printf("July \n");

printf("National Scout Day - 1 July \n");

printf("Tell the Truth Day - 7July \n");

break;

case 8 :

printf("August \n");

printf("Mother's Day - 12 August \n");

printf("National Science Day - 18 August \n");

break;

case 9 :

printf("September \n");

printf("Thai State Enterprise Day - 23 September \n");

printf("Mid-Autumn Festival - 29 September \n");

break;

case 10 :

printf("October \n");

printf("Chulalongkorn Day - 23 October \n");

printf("United Nations Day - 24 October \n");

break;

case 11 :

printf("November \n");

printf("Father of Royal Rainmaking Day - 14 November \n");

printf("Navy Day - 20 November \n");

break;

case 12 :

printf("December \n");

printf("Father's Day - 5 December \n");

printf("Constitution Day - 10 December \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()
{
int i = 1;
float weight,sum = 0;
while (i<=5)
{
printf("Enter Weight :");
scanf("%f",&weight);
sum += weight;
i++;
}
printf("Sum of Weights = %.2f\n",sum);
printf("Average of Weights = %.2f\n",sum/5);
getch();
}

# data[].attributes.body
#include<stdio.h>
#include<conio.h>
int main()
{
int i = 1;
float weight,sum = 0;
do
{
printf("Enter Weight :");
scanf("%f",&weight);
sum += weight;
i++;
}
while (i<=5);
printf("Sum of Weights = %.2f\n",sum);
printf("Average of Weights = %.2f\n",sum/5);
getch();
}

# data[].attributes.body
#include <stdio.h>
#include <conio.h>
int main()
{
for (int i = 1; i <= 10; i++) {
printf("%d\n", i);
}
return 0;
getch();
}

# data[].attributes.body
#include <stdio.h>
#include <conio.h>
int main()
{
for (int i = 1, j = 10; i < j; i++, j--) {
printf("i = %d, j= %d\n", i, j);
}
return 0;
getch();
}