#include<stdio.h>
#include<conio.h>
int findmax(int n1,int n2);
main()
{
int n1,n2,ans;
printf("Enter number1 : ");
scanf("%d",&n1);
printf("Enter number2 : ");
scanf("%d",&n2);
ans = findmax(n1,n2);
printf("The max number is %d",ans);
getch();
}
int findmax(int num1,int num2)
{
int max;
if (num1 > num2)
{
max = num1;
}
else if (num2 > num1)
{
max = num2;
}
return(max);
}
Mai ThAnaWuT BME#4
welcome
วันจันทร์ที่ 5 กันยายน พ.ศ. 2554
หน้า 28
#include<stdio.h>
#include<conio.h>
float myavg(void)
{
float a,b,avg;
printf("Enter a : ");
scanf("%f",&a);
printf("Enter b : ");
scanf("%f",&b);
avg = (a+b)/2;
return(avg);
}
main()
{
float avg;
avg = myavg();
printf("Average is %.2f\n",avg);
getch();
}
#include<conio.h>
float myavg(void)
{
float a,b,avg;
printf("Enter a : ");
scanf("%f",&a);
printf("Enter b : ");
scanf("%f",&b);
avg = (a+b)/2;
return(avg);
}
main()
{
float avg;
avg = myavg();
printf("Average is %.2f\n",avg);
getch();
}
หน้า 27
#include<stdio.h>
#include<conio.h>
char cal_grade(float score);
main()
{
float s;
char grade;
printf("Enter score : ");
scanf("%f",&s);
grade = cal_grade(s);
printf("You get %c !!!",grade);
getch();
}
char cal_grade(float s)
{
char grade;
if (s>=80)
{
grade = 'A';
}
else if (s<80&&s>=70)
{
grade = 'B';
}
else if (s<70&&s>=60)
{
grade = 'C';
}
else if (s<60&&s>=50)
{
grade = 'D';
}
else if (s<50)
{
grade = 'F';
}
return(grade);
}
#include<conio.h>
char cal_grade(float score);
main()
{
float s;
char grade;
printf("Enter score : ");
scanf("%f",&s);
grade = cal_grade(s);
printf("You get %c !!!",grade);
getch();
}
char cal_grade(float s)
{
char grade;
if (s>=80)
{
grade = 'A';
}
else if (s<80&&s>=70)
{
grade = 'B';
}
else if (s<70&&s>=60)
{
grade = 'C';
}
else if (s<60&&s>=50)
{
grade = 'D';
}
else if (s<50)
{
grade = 'F';
}
return(grade);
}
หน้า 23
#include<stdio.h>
#include<conio.h>
#include<math.h>
float power(float n);
float sqroot(float n);
main()
{
float n;
int c;
printf("Enter number : ");
scanf("%f",&n);
printf("Please select choice( 1=power, 2=square root) : ");
scanf("%d",&c);
if(c==1)
{
power(n);
}
else if(c==2)
{
sqroot(n);
}
else
{
printf("Menu Error!!");
}
getch();
}
float power(float n)
{
float mypow;
mypow=pow(n,2);
printf("Result = %.2f ",mypow);
return(mypow);
}
float sqroot(float n)
{
float mysqrt;
mysqrt=sqrt(n);
printf("Result = %.2f ",mysqrt);
return(mysqrt);
}
#include<conio.h>
#include<math.h>
float power(float n);
float sqroot(float n);
main()
{
float n;
int c;
printf("Enter number : ");
scanf("%f",&n);
printf("Please select choice( 1=power, 2=square root) : ");
scanf("%d",&c);
if(c==1)
{
power(n);
}
else if(c==2)
{
sqroot(n);
}
else
{
printf("Menu Error!!");
}
getch();
}
float power(float n)
{
float mypow;
mypow=pow(n,2);
printf("Result = %.2f ",mypow);
return(mypow);
}
float sqroot(float n)
{
float mysqrt;
mysqrt=sqrt(n);
printf("Result = %.2f ",mysqrt);
return(mysqrt);
}
หน้า 20
#include<stdio.h>
#include<conio.h>
#include<math.h>
float fouhtarea();
main()
{
float area;
area=fouhtarea();
printf("4angle area is %.2f\n ",area);
getch();
}
float fouhtarea()
{
float high,minlent,maxlent,area;
printf("enter high : ");
scanf("%f",&high);
printf("enter minlent : ");
scanf("%f",&minlent);
printf("enter maxlent : ");
scanf("%f",&maxlent);
area=high*(minlent+maxlent)/2;
return(area);
}
#include<conio.h>
#include<math.h>
float fouhtarea();
main()
{
float area;
area=fouhtarea();
printf("4angle area is %.2f\n ",area);
getch();
}
float fouhtarea()
{
float high,minlent,maxlent,area;
printf("enter high : ");
scanf("%f",&high);
printf("enter minlent : ");
scanf("%f",&minlent);
printf("enter maxlent : ");
scanf("%f",&maxlent);
area=high*(minlent+maxlent)/2;
return(area);
}
วันอาทิตย์ที่ 14 สิงหาคม พ.ศ. 2554
Vocabulary from song
เพลง Believe Me : Fort Minor
ชอบฟังเพลงนี้สนุกดี และก็มีความหมายที่โดนใจมากครับ ผมชอบๆๆ
ชอบฟังเพลงนี้สนุกดี และก็มีความหมายที่โดนใจมากครับ ผมชอบๆๆ
เนื้อเพลง........ Believe Me
[chorus]
I guess
That this is where we've come to
If you don't want to
Then you don't have to believe me
But I won't be there when you go down
Just so you know now
You're on your own now believe me
I don't want to be the one to blame
You like fun and games
Keep playing em
I'm just sayin
Think back then
We was like one and the same
On the right track
But I was on the wrong train
Just like that
Now you've got a face to pain
And the devil's got a fresh new place to play
In your brain like a maze you can never escape the rain
Every damn day is the same shade of grey
Hey
I used have a little bit of a plan
Used to
Have a concept of where I stand
But that concept slipped right out of my hands
Now I don't really even know who I am
Yo, what do I have to say
Maybe I should do what I have to do to break free
What ever happens to you, we'll see
But it's not gonna happen to me
[chorus]
I guess
That this is where we've come to
If you don't want to
Then you don't have to believe me
But I won't be there when you go down
Just so you know now
You're on your own now believe me
Back then, I thought you were just like me
Somebody who could see all the pain I see
But you proved to me unintentionally
That you would self-destruct eventually
Now I'm thinking like the mistake I made doesn't hurt
But it's not gonna work
Cause it's really much worse than I thought
I wished you were something that you were not
And now this guilt is really all that I got
You turned your back
And walked away in shame
All you got is a memory of pain
Nothing makes sense so you stare at the ground
I hear your voice in my head when no one's around
What do I have to say
Maybe I should do what I have to do to break free
What ever happens to you, we'll see
But it's not gonna happen to me
[chorus]
I guess
That this is where we've come to
If you don't want to
Then you don't have to believe me
But I won't be there when you go down
Just so you know now
You're on your own now believe me
[bridge]
[chorus]
I guess
That this is where we've come to
If you don't want to
Then you don't have to believe me
But I won't be there when you go down
Just so you know now
You're on your own now believe me
Do what i have to do
You're on your own now believe me
What ever happens to you
You're on your own now believe me
What do I have to say
You're on your own now believe me
It's not gonna happen to me
You're on your own now believe me
คำศัพท์จากเพลง
1. Blame แปลว่า ตำหนิ ต่อว่า ใส่ร้าย
จากประโยค I don't want to be the one to blame
แปลว่า ฉันไม่อยากที่จะเป็นคนต่อว่า
2. Track แปลว่า เส้นทาง แนวทางเดิน
จากประโยค On the right track
แปลว่า บนเส้นทางที่ถูกต้อง
3. Maze แปลว่า เขาวงกต
จากประโยค In your brain like a maze you can never escape the rain
แปลว่า ถ้าในสมองของเธอ เหมือนกับเส้นทางเขาวงกต เธอไม่มีทางหนีจากสายฝนได้
4. Damn แปลว่า สาปแช่ง ประณาม เฮงซวย
จากประโยค Every damn day is the same shade of grey
แปลว่า ทุกๆ วันที่เฮงซวยมันก็เหมือนสีเทานั่นแหละ
5. Slipped แปลว่า ล่องเลย หลุดลอย หลุดรอด
จากประโยค But that concept slipped right out of my hands
แปลว่า แต่ความคิดนั้นก็หลุดลอยไป
6. Unintentionally แปลว่า ไม่ได้ตั้งใจ
จากประโยค But you proved to me unintentionally
แปลว่า แต่เธอได้พิสูจน์ให้เห็นโดยไม่ได้ตั้งใจ
7. Shame แปลว่า ความผิดหวังอย่างใหญ่หลวง
จากประโยค And walked away in shame
แปลว่า แล้วเดินออกไปด้วยความผิดหวัง
8. Guilt แปลว่า ความผิด ความรู้สึกผิด
จากประโยค And now this guilt is really all that I got
แปลว่า และตอนนี้ฉันก็มีเพียงความรู้สึกผิด
9. Stare แปลว่า จ้องมอง
จากประโยค Nothing makes sense so you stare at the ground
แปลว่า ไม่สมเหตุสมผลเลย เธอจึงต็องจ้องมองพื้น
10. Go down แปลว่า ตกต่ำ ย่ำแย่
จากประโยค But I won't be there when you go down
แปลว่า แต่ฉันก็จะไม่อยู่ที่นั่น ตอนที่เธอย่ำแย่
วันเสาร์ที่ 13 สิงหาคม พ.ศ. 2554
The stars and the movies
ดารานักร้องที่ชื่นชอบ
1. บี้ สุกฤษฏ์ วิเศษแก้ว เพราะ เค้าเป็นคนมีความสามารถมาก ทั้งร้อง ทั้งเต้น ทั้งแสดง
2. ตุ๊กกี้ สุดารัตน์ บุตรพรหม เพราะเธอเป็นคนตลก มั่นใจในตัวเอง และมีความสามารถด้านการแสดงมาก เธอมาพร้อมกับเสียงฮาจริงๆ มีเธอที่ไหนเป็นต้องฮาอ่ะ
3. อั้ม พัชราภา ไชยเชื้อ เพราะเธอเป็นผู้หญิงที่เซ็กซี่มาก ขยี้ใจทุกคน รอยยิ้มมีเสน่ห์แสนหวานปนเซ็กซี่ การแสดงนั้นขั้นเทพ เล่นได้ดีทุกบทบาท
5. อาทิวราห์ คงมาลัย ( ตูน บอดี้ แสลม ) เพราะ เท่ห์ ร้องเพลงเพราะและมันมาก และที่สำคัญใส่เดฟได้สะใจจริงๆ
1. สิ่งเล็กๆ ที่เรียกว่ารัก เพราะมันซึ้งโครตๆ ทำให้รู้ความหมายของคำว่ารักมากขึ้นและก็ชอบตุ๊กกี้ด้วย
2. Harry Potter เพราะเนื้อเรื่องมันชวนให้เราติดตาม อยากดูต่อไปเรื่อยๆ สนุกดี
3. หอแต๋วแตก เพราะเป็นหนังผีที่แหวกแนวดี ชอบทุกตอน ดูเมื่อไหร่ก็ฮาทุกที
]
4. แฟนฉัน ความรักวัยเด็ก ในอดีตแห่งความทรงจำ ถึงแม่หนูจะอ้วนดำ หนูก็ยังรักของหนูนะ อ้วนดำ อ้วนดำๆๆๆ
5. Avatar เพราะ Avatar เป็นหนังที่มีฉากแปลกๆมากมาย มีเอฟเฟคตระกรานตา ตื่นเต้นมากๆ แม้เนื้อเรื่องไม่ค่อยจะรู้เรื่องเท่าไหร่แต่หลักๆแล้วก็ชอบฉากต่างๆในเรื่องอ่ะ
สมัครสมาชิก:
บทความ (Atom)












