Feb 2, 2013

Fibonacci Program OF 10 NUMBER




#include"stdio.h"
#include"conio.h"
#include"math.h"
void main()
{
clrscr();
int i,f0,f1=1,fibo;
printf("The Fibonacci Series is=");
for(i=1;i<=10;i++);
{
fibo=f0+f1;
printf("%d\t",fibo);
f1=f0;
f0=fibo;
}
getch();
}

Add of n number Program

/*Add of n number Program*/

#include"stdio.h"
#include"conio.h"
#include"math.h"
void main()
{
clrscr();
int i,n,average,sum=0;
printf("Enter the value of n=");
scanf("%d",&n);
for(i=1;i<=n;i++);
sum=sum+i;
average=sum/n;
printf("The Summation is=%d\n",sum);
printf("The Average is=%d",average);
getch();
}

The Series Program

/*The Series Program*/

#include"stdio.h"
#include"conio.h"
#include"math.h"
void main()
{
clrscr();
int i;
printf("The series is=");
for(i=1;i<=50;i++)
printf("\t%d",i);
getch();
}

See Uppercase or lower case yes or not Program

/*See Uppercase or lower case yes or not Program*/

#include"stdio.h"
#include"conio.h"
#include"ctype.h"
void main()
{
clrscr();
char alphabet;
printf("Enter an alphabet=");
scanf("%c",&alphabet);
alphabet=getchar();
if(islower(alphabet))
putchar(toupper(alphabet));
else
putchar(tolower(alphabet));
getch();
}

Factorial Program

/*Factorial Program*/

#include"stdio.h"
#include"conio.h"
#include"math.h"
void main()
{
clrscr();
int i,n,fact=1;
printf("Enter the value of n=");
scanf("%d",&n);
if(n<0)
{
printf("Negative numbers are not allowed");
}
else
if(n==0)
printf("Factorial of =%d%d",n,fact);
else
{
for(i=2;i<=n;i++);
fact=fact*i;
printf("Factorial of=%d%d",n,fact);
}
getch();
}

Odd And Even Number Program

/*Odd And Even Number Program*/

#include"stdio.h"
#include"conio.h"
#include"math.h"
void main()
{
clrscr();
int n;
printf("Enter the Value of n=");
scanf("%d",&n);
if(n%2==0)
printf("This is an Even Number");
else
printf("This is an Odd number");
getch();
}

The Youngs Modulas Program

/*The Youngs Modulus Program*/

#include"stdio.h"
#include"conio.h"
#include"math.h"
#define pi 3.1416
#define g 9.8
void main()
{
clrscr();
float m,L,l,r,y;
printf("Enter the Value of Mass(m)=");
scanf("%f",&m);
printf("Enter the Length of Wire(L)=");
scanf("%f",&L);
 printf("Increasein Length of Wire(l)=);
scanf("%f",&l);
printf("Enter The Radius of Wire(r)=);
scanf("%f",&r);
y=(m*g*L)/(pi*r*r*l);
printf("The Youngs Modulus is=%.2f",y);
getch();
}

Compound Interest Program

/*Compound Interest Program*/

#include"stdio.h"
#include"conio.h"
void main()
{
clrscr();
float p,r,n,f;
printf("Enter the value of principal value.");
scanf("%f"&p):
printf(Enter the number of years.");
scanf("%f"&n);
i=r/100;
i=i+1;
f=p*(pow(i,n));
printf("The final value is=%f",f);
getch()
{












Popular Posts