Friday, May 17, 2013

How to create and explain Tower Game

Name : Om Chanlyta
Major : TMD
 Hello professor this video with code is create tower game :

#include <stdio.h>
#include <stdlib.h>
int main (void)
{
    int m;
    void hanoi(int n, char a, char b, char c);
    printf("Enter the number of discs>");
    scanf_s("%d",&m);
    printf("Step-by-step removal of discs: \n");
    hanoi(m,'1','2','3');
    system("pause");
    return 0;
}
void hanoi(int n, char x, char y, char z)
{
    if(n==1)
        printf("Move the top disk from pole % c to pole %c \n",x,z);
    else
    {
        hanoi(n-1,x,z,y);
        hanoi(1,x,y,z);
        hanoi(n-1,y,x,z);
    }
}



This is my link : http://www.youtube.com/watch?v=KfuUHfXSEik&feature=youtu.be

How to Create Work Dates arithmetic program Tomorrow

Name : Om Chanlyta
Major : TMD

Hello processor these code and video below are show you about how to create work date arithmetic program tomorrow :

#include <stdio.h>
#include <stdlib.h>
int main(){
    struct days
    {
        int day;
        int month;
        int year;
    };
    struct days now,tomorrow;
    int tdate[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
    printf("Input value of day ");
    scanf_s("%d",&now.day);
    printf("\nInput value of month ");
    scanf_s("%d",&now.month);
    printf("\nInput value of year ");
    scanf_s("%d",&now.year);
    if(now.day<tdate[now.month-1])
    {
        tomorrow.day=now.day+1;
        tomorrow.month=now.month;
        tomorrow.year=now.year+1;
    }
    else if (now.month ==12)
    {
        tomorrow.day=1;
        tomorrow.month=1;
        tomorrow.year =now.year + 1;

    }
    else
    {
        tomorrow.day =1;
        tomorrow.month = now.month + 1;
        tomorrow.year = now.year;
    }
    printf("\n tomorrow is day %d month %d year %d \n", tomorrow.day,tomorrow.month,tomorrow.year);
    system("pause");
}





This is my link :
http://www.youtube.com/watch?v=A-dOJmmsT9E&feature=youtu.be

How to create a program to copy the contents of the array A to array B are empty by the number

Name : Om Chanlyta
Major : TMD

#include<stdio.h>
#include<stdlib.h>
#include<string>

int main(){
    int label =5, k = 0;
    int A[5];
    int B[5];
    for(k=0; k<label;k++){
        printf("Please input value %d :\n",k+1);
        scanf("%d", &A[k]);

    }
    printf("Array : int A[5]; \n");
    printf("Index : 1 2 3 4 5 \n");
    printf("Value :");
    for(k = 0; k<label; k++){
        printf("%d",A[k]);
        B[k] = A[k];
    }

    printf("\n\n Array : int B[5]; \n");
    printf("Index : 1 2 3 4 5 \n");
    printf("Value :");
    for (k = 0; k < label; k++){
        printf("%d", B[k]);
    }
    printf("\n");
    system("pause");
}

Below is my video :

This is my link:
http://www.youtube.com/watch?v=1U5YZMMIOyA&feature=youtu.be

How to Create Code Program Exchange Rp to Dolla

Name: Om Chanlyta
Major: TMD


#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main(void)
{
void exchang(int h,int c);
int t, e;
printf("\n Insert Your Money Amount \n");
scanf("%d", &e);
printf("\n Insert rate \n");
scanf("%d", &t);
exchang(t,e);
system("pause");
return(0);
}
void exchang(int h,int c)
{
int t= float(c/h);
int e = c % h;
printf("Your Money Amount = %d \n",c);
printf("Rate = %d \n", h);
printf("You Get Money = %d USA$\n",t);
printf("Your Letf Money = %d \n",e);
}

Below is my video :



This is my link:

http://www.youtube.com/watch?v=OZUrFU-tMgc&feature=youtu.be

How to Write a program that contains a calculation of the volume of a triangular pyramid and volume of a sphere

Hello lecture
My Name: Om Chanlyta
Major: TMD


#include<stdio.h>
#include<stdlib.h>
int main (void)
{

int a;

float b,h1,h2,v,pi=3.14159,r;
do{
printf("Please input value = ");
scanf_s("%d",&a);

switch(a)
{
case 1:
printf("Calculator volume of triangular pyramid\n");
printf("Please input value of base=");
scanf_s("%f",&b);
printf("Please input value of base height= ");
scanf_s("%f",&h1);
printf("please input value of pyramid height=");
scanf_s("%f",&h2);
v=(((b*h1)/2)*h2)/3;
printf("volume of traingular pyramid is=%f\n",v);
break;
case 2:
printf("Calculator volume of sphere\n");
printf("Please input value of radius=\n");
scanf_s("%f",&r);
v=((pi*r*r*r)*4)/3;
printf("volume of sphere is= %f\n",v);
break;
default:
printf("you do not type number 1 or 2 ");
break;
}

}while ((a!=1)&&(a!=2));

system ("pause");
return(0);

}

Below is video of How to Write a program that contains a calculation of the volume of a triangular pyramid and volume of a sphere:

This is my link :

Tugas II : How to use operator in program c

Name : Om Chanlyta
Major : TMD

Hello, professor the video will show about define the calculation operations and explanation in the form of
comments in the code.




below is my link :
http://www.youtube.com/watch?v=Aj0nN-78HmM&feature=youtu.be

Tuesday, October 23, 2012

Write program to run show Area of Trapezium with Microsoft Visaul

Name : Om Chanlyta
Major : TMD

Hello lechure and everyone, This video below is show about create program for compile and run show "Hello World" .



 Below is my link

http://www.youtube.com/watch?v=iC0FpiTFRY4&feature=youtu.be