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
    0

    C Program 9: To Calculate Sum And Average of Array

  • IndianBooktuber
  • Aim: to calculate the sum and average of an array Theory: We will ask the user to input the values into the array and then we would find out the sum and average. Following is the code: #include<stdio.h> #include<conio.h> void main() {     int arr[5], sum= 0, i=0, j;     float avg;     printf("enter...
    read more

    Monday, 26 May 2014

    1

    C Program 8: To find area of equilateral, isosceles and scalene triangle.

  • Monday, 26 May 2014
  • IndianBooktuber
  • Aim: to find the area of triangle. Theory: To find area of triangle isn't as simple as it seems to be. There are three kinds of triangles - equilateral (where all sides are equal), isosceles (where two sides are equal) and scalene (where all three sides are of different length). We will write code to ask the user for what kind of data he has and then on basis of that data we would apply the mathematical formulae. Here's the...
    read more

    Friday, 28 March 2014

    0

    C Program 7: To find the area and perimeter of rectangle and circumference of circle

  • Friday, 28 March 2014
  • IndianBooktuber
  • Aim: The length & breadth of a rectangle and radius of circle are input through the keyboard. Write a program to calculate the area and perimeter of the rectangle, and the circumference of the circle. Theory: you need to know about three mathematical formulas and here you go.. This is the code.. //to find area and perimeter of rectangle...
    read more
    1

    C Program 6: To convert the temperature from Fahrenheit to Celsius.

  • IndianBooktuber
  • Aim: Temperature of a city in Fahrenheit degree is input through the keyboard. Write a program to convert this temperature into Centigrade degrees. Theory: This is one of the basic programs that one should know to make in the C but the only tough part is remembering the formula for conversion of temperature from one scale to another....
    read more
    1

    C Program 5: To find the average and percentage of marks obtained

  • IndianBooktuber
  • Aim: If marks obtained by a student in five different subjects are input through the keyboard, write a program to find out the aggregate marks and percentage marks obtained by the student. Assume that the maximum marks that can be obtained by a student in each subject is 100. Theory: Again, as in the previous program, this program also...
    read more
    7

    C Program 4: To Convert distance in Km to cm, feet, inch and meter.

  • IndianBooktuber
  • Aim: the distance between two cities (in km.) is input through the keyboard. Write a program to convert and print this distance in meters, feet, inches and centimeters. Theory: This program needs no complex coding. It's a simple program where you need to know four basic mathematical formulae. Once you know them, you can easily code this...
    read more
    7

    C Program 3: To calculate the gross salary when the basic salary is entered through keyboard

  • IndianBooktuber
  • Aim: Ramesh's basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary. Theory: We need to take input from user and then apply the simple formula to calculate the gross salary i.e. gross salary= basic salary+...
    read more

    Monday, 24 March 2014

    0

    C Program 2: To Reverse A Number Using An Array

  • Monday, 24 March 2014
  • IndianBooktuber
  • Aim: To reverse a number(digits entered) using an array Theory: At first, we would need to ask the user about how many digits he is going to enter or what is the length of the number which he wants to reverse. Then we would ask him to enter the digits of the number one by one and then we reverse the digit and print the reverse number. Following...
    read more
    0

    C Program 1: To Print The Sum of First Five Natural Numbers Using Arrays

  • IndianBooktuber
  • Aim: To print the sum of first five natural numbers using arrays Theory: For achieving the desired result, we need to put first five natural numbers in form of array. So, we use a for loop so as to enter the first give natural numbers in an array and then calculate their sum. The code for the following would be: //to print the sum of first...
    read more

    Friday, 21 March 2014

    1

    What To Expect Here?

  • Friday, 21 March 2014
  • IndianBooktuber
  • I knew I could simply start with posting the C Programs which I need to code myself just to increase my efficiency in C programming. In fact, I have already posted a few on PerCepTion which is my personal blog but I felt it would not be a good idea to clutter my personal blog with C Programs. Many of my readers are already disappointed with that move so I decided to make things right and started this one. So, by now, from...
    read more

    Subscribe