Posts

Showing posts from April 5, 2013

Excercise in C: Smallest Positive Number

2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?

Excercise in C: Prime Factors

The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ?

Excercise in C: Fibonacci Sequence

Problem: Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.

Excercise in C: String Array with Pointer

Write a Program which will take input as string from terminal after that it will perform arithmetic operation as like calculator. Use Pointer and Array in C. Sample input and output is given below: input : (24/7)+2 output : 5.428