Thursday, 5 June 2014

0

C Program 16: To Print The Fibonacci Series Using Recursion

  • Thursday, 5 June 2014
  • IndianBooktuber
  • Aim: To print fibonacci series Fibonacci series is the one in which every third number is the sum of first two. The series is 1,1,3,4,7,11,18.... //To print the fibonacci series using recursion #include<stdio.h> #include<conio.h> int fibo(int x); void main() {      int a=1, b=1, n,p;      printf("Enter...
    read more
    0

    C Program 15: To Find the Factorial of a number using for loop

  • IndianBooktuber
  • Aim: To find factorial of a number Factorial of a number like 4 would be 4*3*2*1=24 Following would be the code: // To find the factorial of a given number using for loop #include<stdio.h> #include<conio.h> void main() {      int fact, a;      printf("Enter the number: ");      scanf("%d",...
    read more
    0

    C Program 14: To Find The Factorial of a Number Using Recursion

  • IndianBooktuber
  • Aim: To find the factorial using recursion. What is Recursion? when a function calls itself, the phenomenon is referred to as recursion and it is one of the most powerful features of C. Most of the algorithms that are developed using C use recursion. Code:  // To find the factorial of a given number using recursion #include<stdio.h> #include<conio.h> void...
    read more

    Tuesday, 3 June 2014

    0

    C Program 13: To Swap Two Numbers Using Pointers

  • Tuesday, 3 June 2014
  • IndianBooktuber
  • Aim: Swap two numbers using pointers. Following is the code: //To swap two numbers using pointers #include<stdio.h> #include<conio.h> void swap(int *a, int *b) {      int temp;      temp = *a;      *a=*b;      *b=temp;     // printf ("The value of a is: %d...
    read more
    0

    C Program 12: To Print The Given Rectangle Pattern

  • IndianBooktuber
  • Aim: To print this pattern  *-*********** ***-********* *****-******* *******-***** *********-*** ***********-* Code:  #include<stdio.h> #include<conio.h> void main() {      int i, j, k;      for (i=0; i<=5; i++)      {        ...
    read more

    Monday, 2 June 2014

    0

    C Program 11: To Print a Right Angled Triangle

  • Monday, 2 June 2014
  • IndianBooktuber
  • Aim:  To print this pattern * ** *** **** ***** Code: #include<stdio.h> #include<conio.h> void main() {      int i, j, n;      printf("Click on number of lines you want to print: ");      scanf("%d", &n);      for (i=1; i<=n; i++)       {  ...
    read more
    0

    C Program 10: To Find The Smallest Number in an Array

  • IndianBooktuber
  • Aim: To Find the smallest number in an array Code: #include<stdio.h> #include<conio.h> void main() {      int i, arr[5], smallest;      printf("Enter the values in an array: ");      for (i=0; i<=5; i++) /* enter values into array */      {        ...
    read more

    Subscribe