This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Saturday, July 28, 2012

nth Fibonacci Number

Assalamu Alaikum. Hope, you all are well by the grace of Almighty ALLAH. Today we learn how to find out the nth number of the Fibonacci series. Take a look at the problem.

Problem: Write a program that prints the nth term of Fibonacci number.

Fibonacci Series

Assalamu Alaikum. Hope, you all are well by the grace of Almighty ALLAH. Today we learn how to write Fibonacci series until an integer. Take a look at the problem.

Problem: Write a program to obtain the first 25 numbers of Fibonacci sequence.

Friday, July 27, 2012

Index: Wave

Monday, July 23, 2012

Index: Optics

Saturday, July 21, 2012

Perfect Number Generate

Assalamu Alaikum. Hope, you all are well by the grace of Almighty ALLAH. Today we learn how to find out the perfect numbers between two limits. Take a look at the Problem.

Problem: Write a program that prints the list of all perfect numbers between X and Y., where Y>X. User will input the value of X and Y. If X is not lower than Y, a message will be given "Invalid range".

Tuesday, July 10, 2012

Perfect Number

Assalamu Alaikum. Hope you all are well by the grace of Almighty ALLAH. Today we learn how to find out the perfect number. Take a look at the problem.

Problem: A positive integer is entered through the keyboard. Write a program to determine whether the input number is a perfect number or not.

1 + 3 + 5 +.....+n =?

Assalamu Alaikum. Hope you all are well by the grace of Almighty ALLAH. Today we learn how to write an odd series in C programming. Take a look at the problem.

Problem: Evaluate the series up to n.
               1 + 3 + 5 + 7 +.......

Sample Input:   9
Sample Output:  25

Saturday, July 7, 2012

Index: Two Dimensional Array

Matrix Product

Assalamu Alaikum. Hope you all are well by the grace of Almighty ALLAH. Today we learn how to multiply two matrix. Take a look at the program.





Thank you all..:)


Mirror/ Reverse Number

Assalamu Alaikum. Hope you all are well by the grace of almighty ALLAH. Today we learn how to find out the reverse order of an integer number. Take a look at the problem.

Problem: Take an integer number as input. Print the digits of the number in reverse order.

Sample Input: 123456
Sample Output: 654321

Solution:


We can also do this program by the following way.


Thank you all..:)


Friday, July 6, 2012

Factors

Assalamu Alaikum. Hope you all are well by the grace of Almighty. Today we learn how to find out the factors of an integer number. Take a look at the problem.

Problem: A positive integer is entered through the keyboard. Write a program to obtain the factors of this number.

Solution: An integer is divided by which numbers is called the factors of that integer.
Ex. The factors of 12 would be 1, 2, 3, 4, 6, 12
Now take look at the program.


Thank you all..:)

1 2 3 9 4 5 6 18 7 8 9 27

Assalamu Alaikum. Hope you all are well by the grace of Almighty ALLAH. Today we learn how to write a program of a given series. Take a look at the problem.


Problem: Write a C program to find the following series.
          1 2 3 9 4 5 6 18 7 8 9 27

Solution:



Thank you all..:)

Times Table

Assalamu Alaikum. Hope you all are well by the grace of Almighty ALLAH. Today we learn how to do times table programming in C. Take a look at the program.




Thank you all..:)

Bikash

Assalamu Alaikum. Hope you all are well by the grace of Almighty ALLAH. Today we learn how to do BIKASH's program. Take a look at the problem.

Problem: Write a program that takes the customer number & transfer amount from a customer.Then print the bill charges. Let consider the following vat.


Amounts              Vat


1-100                 5/=
101-300               10/=
301-1100              15/=
1101-2600             37/=
2601-4500             73/=
4501-6500             100/=
6501-8500             120/=
8501-10500            135/=
above 10500           1.25%


Solution:



Thank you all..:)

Count odd & even until a negative value

Assalamu Alaikum. Hope you all are well by the grace of Almighty ALLAH. Today we learn how to count odd and even numbers until a negative input. Take a look at the problem.

Problem 1: Ten numbers are entered from the keyboard. Write a program to find out how many of them are even and how many are odd.

Sample input:    0 1 2 3 5 9 -4 -6 0 10
Sample output: Even: 2, Odd: 4

Solution:




Problem 2: Write a program segment that reads positive integer values and count the number of even and odd numbers, until a negative value is read.

Solution: 


We can also do this program by the following way...


We can also do this program by do while loop. Take a look at the program.


Thank you all..:)



Thursday, July 5, 2012

Guess the magic number

Assalamu Alaikum. Hope you all are well by the grace of Almighty ALLAH. Today we learn how to guess an integer number. Take a look at the problem.

Problem: Write a program that plays a computerized form of the "guess the magic number" game. It works like this: The player has ten tries to guess the magic number. If the number entered is the value you have selected for your magic number, have the program print the message "Right" and then terminate. Otherwise, have the program report whether the guess was high or low and then let the player enter another number. This process goes on until the player guesses the number or the ten tries have been used up. Foe fun, you might want to report the number of tries it takes to guess the number.


Solution:



Thank you all..:)

1 + 3 + 9 + 27 + 81 +.............

Assalamu Alaikum. Hope you all are well by the grace of Almighty ALLAH. Today we learn how to find out the nth value from a cub series. Take a look at the problem.

Problem: Write a program which will calculate the value of nth position of this following series.
                 1 + 3 + 9 + 27 + 81 + .................


Sample Input: 4
Sample Output: 27


Solution:



Thank you all..:)

1^3 + 2^3 + 3^3 +.......+ n^3 = ?

Assalamu Alaikum. Hope you all are well by the grace of Almighty ALLAH. Today we learn how to find out the sum of a cube series. Take a look at the problem.

Problem: Evaluate the following series up to n.
                1^3 + 2^3 + 3^3 +...........


Sample Input:  5
sample Output:  225


Solution:


We know that, 1^3 + 2^3 + 3^3 +.......+ n^3 =  {n*(n+1)/2}^2.
Take a look at the program.


Thank you all...:)

1^2 + 2^2 + 3^2 +..........+n^2 = ?

Assalamu Alaikum. Hope you all are well by the grace of Almighty ALLAH. Today we learn how to find out the sum of square series. Take a look at the problem.

Problem: Evaluate the following series up to n.
                    1^2 + 2^2 + 3^2 +..........


Sample Input: 5

Sample Output: 55

Solution:


We know that 1^2 + 2^2 + 3^2 + 4^2 +......+ n^2 =   { n*(n+1)*(2n+1) } / 6. In this program we apply this formula. Take a look at the program.



Thank you all..:)

Wednesday, July 4, 2012

Factorial

Assalamu Alaikum. Hope, you all are well by the grace of Almighty ALLAH. Today we learn how to do factorial problem in C. Take a look at the problem.

Problem: Write a program to calculate the factorial value of any integer entered through the keyboard.


Sample input   :   5
Sample Output  :  120


Solution:



We can also do this program by the following way..


Thank you all..:)


Tuesday, July 3, 2012

Sums until a negative value

Assalamu Alaikum. Hope you all are well by the grace of Almighty ALLAH. Today we learn how to find out the sum of input numbers until a negative number. Take a look at the problem.

Problem: Write a program segment that reads and sums data until  a negative value is read.

Sample Input:

1
2
3
4
5
-2

Sample Output:

15

Solution:




We can also do this program by the following way.


We can do this program by do while loop. Take a look at the program..


We can also do this program by the following way..


Thank you all..:)




Count until a negative number

Assalamu Alaikum. Hope you all are well by the grace of Almighty ALLAH. Today we learn how to count integer number until negative integer number. Take a look at the problem.

Problem: Write a program segment that reads and count until a negative value is read.

Sample Input:
5
6
4
2
1
-5

Sample Output:

Total : 5

Solution:






We can also do this program by the following way...


We can also do this program by do while loop. Take a look at the program.


Thank you all..:)


Monday, July 2, 2012

Digit to Number

Assalamu Alaikum. Hope you all are well by the grace of Almighty. Today we learn how to make an integer number from some digits.Take a look at the problems.

Problem 1: Write a program that takes digits from the user until a negative digit. When an user puts  negative digits it shows the integer number which is combined by those digits.

Sample Input:

1
5
6
0
-2

Sample Output:

1560

Solution:




Problem 2: Write a program that takes the digits from the user until End of File. Then it shows the integer number which is combined by those digits.

Sample Input:

1
5
6
^Z

Sample Output:

156

Solution:



To End the input we have to press ctrl + Z.
Thank you all..:)

Loop: Digit Sum

Assalamu Alaikum. Hope you all are well by the grace of Almighty. Today we learn how to find the sum of digit(s) of an integer. Take a look at the problem.

Problem: A positive integer is entered through the keyboard. Write a program to calculate sum of all the digits of the number.

Solution:



Thank you all..:)

Loop: Digit Count

Assalamu Alaikum. Hope you all are well by the grace of Almighty ALLAH. Today we learn how to count digit(s) from an integer number. take a look at the program.


Thank you all..:)

Sunday, July 1, 2012

Find out the Range

Assalamu Alaikum. Hope, you all are well by the grace of Almighty ALLAH. Today we learn how to find out the range from some integer numbers.

Problem: Write a program to find the range of a set of numbers. Range is the difference between the smallest and biggest number in the list.


Solution:





Thank you all...:)