Monday, February 28, 2011

0

C Program Language (Math.h Function - Fabs,Floor,Ceil)

  • Monday, February 28, 2011
  • RJ
  • These program is all about the functions fabs, floor and ceil. Discover how those function works and the importance in the C programming language. At this time also I will be using math.h which is very important in solving mathematical operations.
    The problem: Show the value of x after each of the following statement is performed.


    a. x =  fabs (7.5)
    b. x = floor  (7.5)
    c. x = fabs (0.0)
    d. x = ceil  (0.0)
    e. x = fabs (-6.4)
    f. x = ceil (-6.4)
    g. x = ceil (-fabs ( -8 + floor (-5.5))) 


    Observe the output below.


    The complete codes for the output.
    read more

    Sunday, February 27, 2011

    0

    C Program Language (Bank Problem)

  • Sunday, February 27, 2011
  • RJ


  • This is the output in calculating the charges of interest. In this c program, it shows how to get the total amount of percentage. It ask the use to input the principal amount, the percent rate per month and the months to pay. Not try to see the codes that were being used.
    read more
    0

    C Program Language (Ascending or Descending)

  • RJ
  • The problem is to create a program will ask the user a number and counts that the user wished to have and on what order will it count. And in this problem I used for repetition statement in getting the correct program. And here is the output of the program for ascending.



    read more

    Saturday, February 26, 2011

    0

    C Program Language (using stdlib.h to repeat)

  • Saturday, February 26, 2011
  • RJ
  • The header stdlib.h is very important in C language because it allow the user to repeat again to the main or exit/end the program. This used when the condition is given from the program and asked to repeat again or terminate. As we go along in our topic we will learn the different ways how to used the stdlib.h header in repeating the condition. Here are some example output that instruct the user either to repeat or to exit.


    As you can see above. The is asked the user to input integer and instruct the if the user will going to repeat or not. The user is being asked to input integer 1 to repeat and other integer to end. Now see the codes.
    read more
    0

    C Program Language (Switch Loop - Calendar)

  • RJ
  • This time we will going create a program using switch looping and the example activity is the calender with their corresponding days. This is the sample problem

    Create a program that will ask the user to enter a number from 1-12 then print its corresponding month and count o days, otherwise it will print INVALID INPUT! (Use SWITCH)
    Ex.             Enter number (1-12): 3
                      March has 31 days

    Here is the sample output for the user inputed numbers from 1-12 and a statement if the user will repeat or terminate.


    And the another output below shows invalid input and again the program ask the user to repeat again or terminate.


    The codes will be shown below for these program.
    read more

    Friday, February 25, 2011

    0

    C Program Language (Skip Count by 3 and 5)

  • Friday, February 25, 2011
  • RJ
  • I was asked by my teacher to create a program using while repetition statement skip counting by 3 and skip counting by 5. Thinking how to create it I was puzzled first on how to accomplish my task. To create the program I must think first the different ways on how to solve the program and I figured out the solution. 
    Now check this program skip counting by 3.


    Here is the codes of the program skip counting by 3.

    #include<stdio.h>
    #include<conio.h>
    
    int main()
    
    {
    int x;
    
    x=3;
    
    while (x <= 48)
    {
    if(x == 3){
    x=x-2;
    printf("%d   ",x);
    }
    else{
    x = x + 3;
    printf("%d   ",x-1);
    }}
    getch();
    }
    
    
    
    
    Now check the program below using the skip counting by 5. I used the do while repetition statement in creating the program.
    
    
    
    
    
    

    The codes for skip counting by 5.

    #include<stdio.h>
    #include<conio.h>
    
    main()
    {
    int x;
    
    x=5;
    do
    {
    if(x==5){
    x=x-4;
    printf("%d   ",x);}
    else{x=x+5;
    printf("%d   ",x-1);
    }
    }
    while (x<=50);
    
    getch();
    
    }
    
    
    
    The repetition statement is very important in programming it is all due because it is being used by a programmers to loop the program simultaneously. Hope this program can help you on how to used the repetition statement.
    read more

    Thursday, February 24, 2011

    0

    C Language: Basic Operation (addition,subtraction,multiplication,division)

  • Thursday, February 24, 2011
  • RJ
  • This program is about the basic operation of C language such as addition,subtraction,multiplication and division. Observe the codes and on how i used the + for addition, - for subtraction, * for multiplication and / for division. Just like common mathematics solution c language is also convenient to use and have a lot of usage. Without further much check the output of my program.



    It's so funny because my program is so basic and simple. Well, maybe I will also how to use the other operations of mathematics that the C language can be used. Now try to check the codes that i have used. For me it's a good start and somehow I can do better than these.

    read more

    Tuesday, February 22, 2011

    0

    Finals is Fast Approaching

  • Tuesday, February 22, 2011
  • RJ
  • Everywhere you go in my school, students are really busy in their different jobs. It is all due to the fact that our finals is fast approaching. Everybody must be prepared in fixing their different requirements in their subjects. I feel like my head is going to explode because of different projects,assignments and other requirements. A lot of things to do and the worst thing about it is that it is so cold. Every morning when I wake up just to study. Hope I have a big scores on my exams.
    read more

    Monday, February 21, 2011

    0

    My First Program

  • Monday, February 21, 2011
  • RJ
  • My life as an I.T student has just started and I am in the first stage of programming. The first language that should learn is the C language not just because it is the required language for us but also it is the foundation of all language. If i learn that language it would be easy for me to adapt the other language needed to accomplish my course. Now try to look my simple program.


    Try to look at the codes of my program...


    #include<stdio.h>
    #include<conio.h>
    main()
    {
          printf("Hello World!");
          getch();
          }


    Maybe next time my program would be better than these. All I have to do is practice and gain learnings. :)

    read more

    Subscribe