// C08_Ex 9: Input 3 whole number.// 3 This is an integer form three sides of a triangle or not ?// If so, what is the triangle?#include <stdio.h>void main(){ int a, b, c; printf("Input 3 whole number: "); scanf("%d%d%d", &a, &b, &c); if (a + b > c && a + c > b && b + c > a) { ...
// 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) ...
// 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...
// 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; ...
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,...
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...
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: "); ...
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); ...
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...