cstartercodes.blogspot.com
C Beginner Examples: Swap Two Numbers Using Pointers
http://cstartercodes.blogspot.com/2015/02/swap-two-numbers-using-pointers.html
Monday, February 9, 2015. Swap Two Numbers Using Pointers. Here is the code for swapping two numbers using a function which is based on pointers. The basic concept used is pass by reference. Void swap(int *x, int *y). Tmp = *y;. Printf("Enter two numbers: ");. Scanf("%d%d", &a, &b);. Printf(" nBefore swapping: a = %d and b = %d n", a, b);. Swap(&a, &b);. Printf("After swapping: a = %d and b = %d n", a, b);. Enter two numbers: 10 20. Before swapping: a = 10 and b = 20. After swapping: a = 20 and b = 10.
cstartercodes.blogspot.com
C Beginner Examples: March 2015
http://cstartercodes.blogspot.com/2015_03_01_archive.html
Saturday, March 7, 2015. Calculating the HCF and LCM of two numbers. Here is the program to calculate the Highest Common Factor (HCF - also known as Greatest Common Divisor). And Lowest Common Multiple (LCM). Of two numbers. The code is extremely simple. Unsigned int a, b, i, hcf;. Printf("Enter two positive integers 0: ");. Scanf("%d%d", &a, &b);. For(i=1; i =(a b? Printf(" nThe HCF of %d and %d is %d n", a, b, hcf);. Printf("The LCM of %d and %d is %d n", a, b, ( a*b)/hcf) ;. Chooses the smallest of a.
cstartercodes.blogspot.com
C Beginner Examples: Number/Currency to Words Conversion
http://cstartercodes.blogspot.com/2015/03/number-to-words-conversion.html
Friday, March 6, 2015. Number/Currency to Words Conversion. This program helps us to convert a number ( 1000) into words. That is, you give 912 and it says 'nine hundred and twelve! 25 February, 2015 */. Updated on 21 October, 2015 */. Char ones[][10] = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};. Char tenAbove[][10] = {"eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"};. Printf("Enter the amount ( 10,000): ");. Amt %= 1000;.
techtipsnan.blogspot.com
Tech Tips!: Time Machine of the Web!
https://techtipsnan.blogspot.com/2015/02/time-machine-of-web.html
Wednesday, February 11, 2015. Time Machine of the Web! Many characters in science fiction have got the opportunity to travel through time. It is the imaginary tool called time machine. Which helped them to do it. But do you know you can also have this magic journey in real life? The website archive.org. Has a tool named Wayback Machine. Which helps you to browse through the previous states of a particular website. For example, if you want to know how Google looked in past, just type.
cstartercodes.blogspot.com
C Beginner Examples: Calculating the HCF and LCM of two numbers
http://cstartercodes.blogspot.com/2015/03/calculating-hcf-and-lcm-of-two-numbers.html
Saturday, March 7, 2015. Calculating the HCF and LCM of two numbers. Here is the program to calculate the Highest Common Factor (HCF - also known as Greatest Common Divisor). And Lowest Common Multiple (LCM). Of two numbers. The code is extremely simple. Unsigned int a, b, i, hcf;. Printf("Enter two positive integers 0: ");. Scanf("%d%d", &a, &b);. For(i=1; i =(a b? Printf(" nThe HCF of %d and %d is %d n", a, b, hcf);. Printf("The LCM of %d and %d is %d n", a, b, ( a*b)/hcf) ;. Chooses the smallest of a.
cstartercodes.blogspot.com
C Beginner Examples: Solution of Quadratic Equation
http://cstartercodes.blogspot.com/2015/02/solution-of-quadratic-equation.html
Thursday, February 12, 2015. Solution of Quadratic Equation. Here is the code for calculating the root(s) of a quadratic equation. Note: compile with -lm option to link with the math library (for sqrt(). Eg: gcc quadratic.c -lm. Printf("Enter the values for a, b, and c: ");. Scanf("%d%d%d", &a, &b, &c);. Disc = (b*b)-(4*a*c); /* discriminant */. If(disc 0) /* Two real roots */. Printf("The solutions are %f and %f n", (-b sqrt(disc) /(2*a), (-b-sqrt(disc) /(2*a) ;. Else if(disc 0) /* Two imaginary roots */.
techtipsnan.blogspot.com
Tech Tips!: Google Eggs!
https://techtipsnan.blogspot.com/2015/02/google-eggs.html
Wednesday, February 11, 2015. Computer also has some Easter eggs! They pop out unexpectedly. Let us hunt some Google Easter Eggs that can be used to amaze ourselves and our friends. In Google and the search page revolves! Will make the search results tilt. Wonder how Google looked in 1998? And the search result comes in an old-fashioned page! To make you computer screen a playground, try. Use the force, luke. In YouTube and the amazement is for you! Subscribe to: Post Comments (Atom).
techtipsnan.blogspot.com
Tech Tips!: February 2015
https://techtipsnan.blogspot.com/2015_02_01_archive.html
Wednesday, February 11, 2015. Computer also has some Easter eggs! They pop out unexpectedly. Let us hunt some Google Easter Eggs that can be used to amaze ourselves and our friends. In Google and the search page revolves! Will make the search results tilt. Wonder how Google looked in 1998? And the search result comes in an old-fashioned page! To make you computer screen a playground, try. Use the force, luke. In YouTube and the amazement is for you! Time Machine of the Web! The website archive.org.
cstartercodes.blogspot.com
C Beginner Examples: Currency Denomination
http://cstartercodes.blogspot.com/2015/02/currency-denomination.html
Monday, February 9, 2015. You will wonder once you realise how powerful this simple code is! Given an amount, this program will print the denomination. For it. The reason this code became really compact is, it makes use of array. Int currencies[] = {1000, 500, 100, 50, 10, 5, 2, 1};. Long int amount;. Int buf, pos = 0;. Printf("Enter the amount: ");. Scanf("%ld", &amount);. Buf = amount/currencies[pos];. Printf("%d X %d n", currencies[pos], buf);. Amount -= currencies[pos]*buf;. Enter the amount: 2313.