Checkout cost of taxi

Tuesday, June 29, 2010

// C08_Ex 7: Checkout cost of taxi from kilometer input. Known:// First km: 5$// 2 -> 5 km price: 4$// 6 km -> price:  3$// If > 120km , will sale 10% #include <stdio.h>#define G1 5#define G2 4#define G3 3void main(){    int n;    float cost;    printf("Input numbers of km (>0): ");    scanf("%d", &n);    if (n == 1)      ...
Read more »

Arranging numbers in ascending order in C

Monday, June 28, 2010

// C08_Ex 6: Input 4 whole number// To arrange this numbers in order of in ascending#include <stdio.h>void main(){    int a, b, c, d, tempt;    printf("Input a, b, c, d: ");    scanf("%d%d%d%d", &a, &b, &c, &d);       if (a > b) { tempt = a; a = b; b = tempt; }    if (a > c) { tempt = a; a = c; c = tempt; }    if...
Read more »

Find minimum number

Sunday, June 20, 2010

// C08_Ex 5:Input 4 whole number a, b, c, d// Find minimum number#include <stdio.h>void main(){    int a, b, c, d, min, max;    printf("Input a, b, c, d: ");    scanf("%d%d%d%d", &a, &b, &c, &d);       min = a;    if (b < min) min = b;    if (c < min) min = c;    if (d < min) min = d;  ...
Read more »

Solve quadratic equations in C

Friday, June 18, 2010

Today, I tried to translate the very basic "solve quadratic equations" program. I made it while i use C complier of Microsoft : Visual Studio 2005. I have used it since i was a first year student// C08_Ex 4: To solve quadratic equation: ax^2 + bx + c = 0#include <stdio.h>#include <math.h>void main(){    int a, b, c;    printf("Input a, b, c: ");    scanf("%d%d%d", &a, &b,...
Read more »

To solve a simple equation in C

Wednesday, June 16, 2010

Whether you are in middle school, high school or even college, you will quickly learn that knowing how to solving equations is essential to any mathematics class. The majority of applications in mathematics will end up in an equation, and you will have to be able to solve that equation in order to answer the original problem. By going over the steps to solving two different linear equations, you will get a better understanding of how they...
Read more »

How to convert a lowercase/uppercase character in C ?

Monday, June 14, 2010

C08_Ex 2:  Enter one letter. If it is  uppercase character, changed to lowercase letters, changed back to uppercase.// Input a character// If It's a  upper-case character -> change into lower-case character// If It's a  lower-case character -> change into upper-case character// Use Visual Studio 2005 #include <stdio.h>void main(){    char ch;    printf("Input a character: ");   ...
Read more »

Read a whole number from 1 to 9

C08_Ex 1: Input a  whole number.Reading this whole number with value from 1 to 9.Default, Output:  "Don't know how to read". // Input a  whole number.// Reading this whole number with value from 1 to 9.// Default, output Don't know how to read.// Use Visual Studio 2005 #include <stdio.h>void main(){    int n;    printf("Input a  whole number: ");    scanf("%d", &n);   ...
Read more »

ASCII Chart

Saturday, June 12, 2010

If you a coder, ASCII Chart is so not strange with you. You are a new coder or a student, even professional programmers when you code a program, you often use ASCII Table to solve some problem. In this post I will present some basic definitions about ASCII Chart. ASCII - The American Standard Code for Information Interchange is a standard seven-bit code that was proposed by ANSI in 1963, and finalized in 1968. Other sources also credit...
Read more »

 
 
 
 
Copyright © 2010 C Source Code - C++ Source Code. All Rights Reserved. Using Xclear Theme | Bloggerized by Themescook Developed by Helios | Powered by Blogger