C Program for BANK OPERATION

#include<stdio.h>
#include<conio.h>
void creation();
void deposit();
void withdraw();
void bal();
int a=0,i = 101;
struct bank
{
int no;
char name[20];
float bal;
float dep;
}s[20];
void main()
{
int ch;
while(1)
{
clrscr();
printf("\n*********************");
printf("\n BANKING ");
printf("\n*********************");
printf("\n1-Creation");
printf("\n2-Deposit");
printf("\n3-Withdraw");
printf("\n4-Balance Enquiry");
printf("\n5-Exit");
printf("\nEnter your choice");
scanf("%d",&ch);
switch(ch)
{
case 1: creation();
break;
case 2: deposit();
break;
case 3: withdraw();
break;
case 4: bal();
break;

case 5: exit(0);
defalut: printf("Enter 1-5 only");
getch();
}
}
}
void creation()
{
printf("\n*************************************");
printf("\n ACCOUNT CREATION ");
printf("\n*************************************");
printf("\nYour Account Number is :%d",i);
s[a].no = i;
printf("\nEnter your Name:");
scanf("%s",s[a].name);
printf("\nYour Deposit is Minimum Rs.500");
s[a].dep=500;
a++;
i++;
getch();
}
void deposit()
{
int no,b=0,m=0;
float aa;
printf("\n*************************************");
printf("\n DEPOSIT ");
printf("\n*************************************");
printf("\nEnter your Account Number");
scanf("%d",&no);
for(b=0;b<i;b++)
{
if(s[b].no == no)
m = b;
}
if(s[m].no == no)
{
printf("\n Account Number : %d",s[m].no);
printf("\n Name : %s",s[m].name);
printf("\n Deposit : %f",s[m].dep);
printf("\n How Much Deposited Now:");
scanf("%f",&aa);

s[m].dep+=aa;
printf("\nDeposit Amount is :%f",s[m].dep);
getch();
}
else
{
printf("\nACCOUNT NUMBER IS INVALID");
getch();
}
}
void withdraw()
{
int no,b=0,m=0;
float aa;
printf("\n*************************************");
printf("\n WITHDRAW ");
printf("\n*************************************");
printf("\nEnter your Account Number");
scanf("%d",&no);
for(b=0;b<i;b++)
{
if(s[b].no == no)
m = b;
}
if(s[m].no == no)
{
printf("\n Account Number : %d",s[m].no);
printf("\n Name : %s",s[m].name);
printf("\n Deposit : %f",s[m].dep);
printf("\n How Much Withdraw Now:");
scanf("%f",&aa);
if(s[m].dep<aa+500)
{
printf("\nCANNOT WITHDRAW YOUR ACCOUNT HAS MINIMUM BALANCE");
getch();
}
else
{
s[m].dep-=aa;
printf("\nThe Balance Amount is:%f",s[m].dep);
}
}

else
{
printf("INVALID");
getch();
}
getch();
}
void bal()
{ int no,b=0,m=0;
float aa;
printf("\n*************************************");
printf("\n BALANCE ENQUIRY ");
printf("\n*************************************");
printf("\nEnter your Account Number");
scanf("%d",&no);
for(b=0;b<i;b++)
{
if(s[b].no == no)
m = b;
}
if(s[m].no==no)
{
printf("\n Account Number : %d",s[m].no);
printf("\n Name : %s",s[m].name);
printf("\n Deposit : %f",s[m].dep);
getch();
}
else
{
printf("INVALID");
getch();
}
}

C Program for finding COS THETA Value
#include<stdio.h>
#include<conio.h>
#include<math.h>
#define ACC 0.0001
#define PI 3.14

term.cosz). cosz=term.h> void main() { double term=1.expo).expo=1. clrscr(). float x1. // printf("%f". expo+=term.void main() { int x.x. clrscr(). getch().&x). x1=(x*PI)/180. scanf("%f".cosz=0.i=i+2) { term = (x2*(-term))/(i*(i-1)). scanf("%d".term>=0.&x). printf("Enter the X value:"). cosz = cosz+term. printf("Enter the exp value of x: "). } C Program for Exponential value #include<stdio.00001. getch(). } printf("\nNew Value%f".x2. x2=x1*x1. term=1. for(i=2. } printf("\Our Exp = %f %f\n".cos(x1)).h> #include<conio. for(i=1.i. } .i++) { term *= x/i.fabs(term)>ACC. float x. int i.

h> int fact(int).&a). printf("%d". } b=fact(a).h> #include<conio. } } C Program for fibanacci series using recursion. while(a<0) {printf("\n\Enter only positive number.b. scanf("%d".c.b=0.c. scanf("%d". } int fact(int x) { if(x==0) { return(1). void main() { int a. printf("Enter N value:"). } else { return((x)*(fact(x-1))).i.\n"). getch().h> #include<conio.b). printf("Enter the N value:"). . #include<stdio.h> int fib(int).C Program for factorial using recursion #include<stdio. clrscr().&a). clrscr(). void main() { int a.

c=0. #include<stdio.i++) { printf("\n%d".a[i]!='\0'. printf("*********************"). } getch().&a). for(i=0. printf("Please Enter a String:\n"). for(i=0.h> void main() { int i. } . printf("\n\n"). scanf("%s".printf("Enter the N value"). char a[50]. printf("OUTPUT\n").fib(i)). if(x<=1) { return(1). } } C Program for String Length.i<a.i++) { c=c+1. } else { return(fib(x-1)+(fib(x-2))).a). } int fib(int x) { if(x==0) return(0). clrscr(). scanf("%d". printf("------").h> #include<conio.

printf("\n3-SORT BY BOOK NAME"). printf("\n5-EXIT"). #include<stdio. while(1) { clrscr(). scanf("%d".h> int i=0.printf("\n\n"). char author[50]. void add(). void search(). printf("Length Of The Given String is=%d\n". void sort(). } C Program for Library Operation. printf("\n2-SEARCH A BOOK"). printf("\n1-ADD TO LIBRARY").&ch). getch().h> #include<conio. printf("\nEnter your choice:"). void main() { int ch. printf("********************"). void sorta(). printf("\nLIBRARY MANAGEMENT"). case 2: search(). . }book[50]. int nocopy. printf("*****************************"). printf("\n4-SORT BY AUTHOR NAME"). switch(ch) { case 1: add().c). break. printf("\n******************"). struct book { char bookname[50]. double price.

printf("\nEnter the Bookname: ").bookname).bookname. break.x.nocopy). fflush(stdin). gets(authorname). printf("\nBOOK NAME: %s". gets(book[i].price). printf("\nPRICE : %d".book[i]. } void search() { int f=0. printf("\nEnter no of copies : "). fflush(stdin). printf("\nEnter the Price of the Book: "). default: puts("Please enter 1-5 only"). } } } void add() { printf("\n\nADD TO LIBRARY"). scanf("%d". printf("STORED").book[i]. break. printf("\nNO OF COPIES: %d".book[i]. case 4: sorta(). fflush(stdin).bookname).author). printf("\n Enter the Author Name: "). . i++. gets(bookn). scanf("%ld". printf("\nAUTHOR : %s".break. getch(). getch(). printf("\nThe Given Search"). case 3: sort().bookn).authorname). char bookn[50]. fflush(stdin). printf("\nThe Author Name is : %s".j++) { x= strcmp(book[j].book[i]. gets(book[i]. printf("\nEnter the Author name: ").authorname[50]. printf("\n Enter the Book Name: "). for(j=0.nocopy). printf("\nThe Book Name is: %s".j<i.bookn).&book[i]. case 5: exit(0).author).j.y.&book[i].price).

bookname. . strcpy(book[k+1].bookname).k<j. } void sorta() { int j.j++) { printf("\nThe BookName is:%s . for(j=0.book[k+1].book[j].k.k<j. } } if(f==0) { printf("\nBOOK NOT FOUND"). } getch().k++) { x = (strcmp(book[k].authorname).%s".j<i.book[k]. getch().author.bookname.book[k+1]. for(j=0.j++) { for(k=0. char t[50]. } void sort() { int j.author. for(j=0.bookname .k++) { x = (strcmp(book[k]. if(x>0) { strcpy(t.j<i.bookname)).k.author). t). getch().bookname.x.author)). } } } printf("\nSORTED BY BOOK NAME").book[k+1].y=strcmp(book[j]. } getch(). strcpy(book[k].x.j++) { for(k=0. char t[50]. if(x==0&&y==0) { printf("\nBOOK IS FOUND").bookname). f=1.book[j].j<i.

x=1.author).i++) { for(j=1.j++) { if(j==1) { x=1.bookname). printf("Please Enter the Number :").book[k+1]. printf("\n\n").j<i. printf("------").&num). strcpy(book[k+1]. t).num.h> #include<conio.j.if(x>0) { strcpy(t.j<=i. strcpy(book[k].book[j]. } C PROGRAM FOR PASCAL TRIANGLE.author. scanf("%d".j++) { printf("\nThe AUTHOR NAME is:%s . printf("OUTPUT:\n").%s".x). printf("The Pascal triangle is\n").author). } } } printf("\nSORTED BY AUTHOR NAME"). for(j=0.author. printf("\n\n"). clrscr(). printf("%d".h> void main() { int i=1.x). } } . printf("%d".book[k]. for(i=1.i<=num.author .book[j]. } getch(). printf("**********************\n"). #include<stdio. } else { x=(x*(i-j+1)/(j-1)).

i<j. printf("The Prime Number series is\n"). for(j=1.j<=n.i++) { if(j%i==0) { a=1. scanf("%d".h> void main() { int n.printf("\n"). } getch(). .j. printf("------"). } } if((a==0)&&(j!=1)) { printf("\n%d". printf("**************************"). } getch(). goto x. } C Program for Prime Number Generation.h> #include<conio.i. #include<stdio.&n).j++) { for(i=2. clrscr(). printf("\n\n"). printf(" Please Enter a number :").j). printf("\n\n"). printf("OUTPUT:\n"). } x: a=0. } C Program For REPLACE OF STRING.a=0.

i++) l2=i.a[i]!='\0' && b[j]!='\0'.c[100].l1. printf("\t\t\t REPLACE OF STRING ").b). if(l1>=l2) { do { for(i=0.c). clrscr().l3. for(i=0. d[i]='\0'.i++ ) { if(a[i]==b[j]) { count++.a[i]!='\0'. for(i=0.count=-1.c[i]!='\0'.h> #include<conio. printf("\n\nEnter the first String:"). for(i=0.j.i++) l1=i. if(j>0) i--. printf("\n\t*******").a[i]!='\0'.j=0.b[i]!='\0'.i++) d[i]=a[i]. scanf("%s".a). } } . printf("\n\n\tINPUT").k. printf("\n\t*******").#include<stdio.b[100].l2.i++) l3=i.d[100].h> void main() { char a[100]. j++. printf("\nEnter the substring:"). for(i=0. int i. printf("\n\t\t\t ********************"). j=0. printf("\nEnter the replace string:"). } else { count=-1.m. scanf("%s". scanf("%[a-z ]s". printf("\n\n\tOUTPUT").

h> #include<conio. printf("The Reverse Of The Given String is\n"). printf("------"). } . for(k=0.a). clrscr(). } C Program For String Reverse.j--) { printf("%c". //printf("\nReplaced string:%s". printf("OUTPUT\n").h> void main() { char n[50].d[m]!='\0'.i=0. printf("Enter String:\n"). }while(a[i]!='\0'). #include<stdio.i++. while((n[i]=getchar())!='\n')i++.j.n[j]).i++) { a[i]=d[m]. if(l2!=l3) { for( .j>=0. printf("\nReplaced string:%s". } else break. //printf("\nThe substring is not there").c[k]!='\0'. } } //a[i]='\0'.m++.k++) a[i]=c[k].a).m=i. for(j=i-1. if(count==l2) { i=i-j. printf("**********************************"). } getch().

scanf("%d".h> void main() { int ss[50][50]={0}.a<sale.b<i.a.h> #include<conio. printf("\n\t\t"). for(b=0.b. printf("\n*********************SALES REPORT*************************"). } .&i).a+1).getch(). for(a=0.y.b++) { printf("item[%d] ". int x.a++) { for(b=0. scanf("%d".b+1).a+1. printf("\nEnter the How many Items:").b++) { printf(" %d\t".b<i.b<i.i.&ss[a][b]).b++) { printf("Sales man [%d] item [%d]:". clrscr().b+1).a<sale. for(b=0. printf("\n********************************************************** \n").a++) { printf("\nSales man [%d]". for(a=0. t+=ss[a][b]. printf("\n********************************************************** "). } } clrscr().t=0.&sale).ss[a][b]). printf("\nEnter the How many sales man:"). } printf(" Total"). } C Program for salesman problem. #include<stdio.sale. scanf("%d".

a++) { for(b=0. for(a=0.&x).sine=0. printf(" %d\t".i. . scanf("%d".b<sale.h> #include<conio. printf("Enter the X value:"). x=0. term=x1.000001 #define PI 3.x2.a<i. x=0. clrscr().x). } printf("\n********************************************************\n" ). } C Program for sine series. getch().y=0.term.14 void main() { int x. x1=(x*PI)/180.t).y).printf(" %d". #include<stdio. x2=x1*x1.b++) { x=x+ss[b][a]. t=0. float x1. } printf(" %d\t".h> #define ACC 0. } y=y+x. printf("\t\t"). printf("TOTAL :").h> #include<math. printf("\n********************************************************").

} printf("\n%f".roll=101.i=i+2) { term = (x2*(-term))/(i*(i-1)).&s[k].sine).i<no.&no).rn=roll. void main() { int no. }s[30].sine=term.total.result. char grade. } C Program for STUDENT MARKLIST. } .m2>=35 && s[k].m3).rn).m1).&s[k]. for(i=0.i++) { clrscr(). struct stud { int rn. #include<stdio.m3.&s[k].m2).m1>=35 && s[k].h> int k=0. for(i=3. printf("\nEnter the Three Marks"). int m1.i.s[k]. scanf("%d". fflush(stdin). gets(s[k]. s[k].fabs(term)>ACC. getch().h> #include<conio. printf("Enter NO of Students:"). sine = sine+term. printf("\nEnter the Student Name:"). char name[30]. scanf("%d".m3>=35) { s[k]. printf("\nEnter the Student Roll Number: %d ". scanf("%d". clrscr().result='P'. if(s[k]. scanf("%d".m2. float avg.name).

avg>=35) { if(s[k].total). if(s[k].grade = 'A'. s[k]. } else { s[k].avg>=60) { if(s[k].m1+s[k]. printf("\n*******************************************************").result == 'P') { s[k].result == 'P') { s[k].grade = 'N'. printf("The Total is : %d".s[k]. } printf("\n*******************************************************").m2+s[k]. } } else if(s[k].grade = 'C'.grade = 'N'.avg>=50) { if(s[k].else { s[k]. printf("\n STUDENT MARKLIST ").grade = 'N'.total = s[k]. } } getch().result == 'P') { s[k]. } else { s[k].grade = 'B'.result = 'F'. } s[k]. k++. } } else if(s[k].avg=s[k]. . } else { s[k].m3. roll++.total/3.

for(i=0. f=0.rn.i<no. } else { if(f==1) { .s[i]. scanf("%s". scanf("%s". printf("OUTPUT\n").result.s[i].a). printf("\nEnter First String:"). int i.s[i].printf("\nROLL \tNAME MARK1 MARK2 MARK3 TOTAL RESULT Average GRADE"). f=1.l2.grad e).s[i].l1. printf("\nEnter String to Search:").b). if(c==l2)goto y.1f %c". for(i=0.i++) { x: if(b[j]==a[i]) { c++.s[i]. } getch().s[i]. #include<stdio. l1=strlen(a).c.f. l2=strlen(b).m1.i<l1.i++) { printf("\n%d\t%s %d %d %d %d %c %0.m2.b[30].name.m3. clrscr(). c=0.total.h> #include<conio. j=0.s[i].s[i].avg.j. printf("\n\n"). } C Program for SubString.h> void main() { char a[30]. printf("------\n").s[i]. j++.

j. goto x.i++) { for(j=1. } C Program For to find largest and smallest value in two dimension matrix.j<=c.largest=0. scanf("%d". .j<=c. else printf("\n\t\tWord Not Found").i<=r.t.&r. for(i=1.a[10][10]. #include<stdio. for(i=1.&a[i][j]).i<=r.h> void main() { int i. f=0.z=1. printf("Enter the r and c value:").j++) { if(largest { largest=a[i][j]. c=0. scanf("%d%d".j++) { printf("a[%d][%d]=". } } largest=0. getch(). clrscr().h> #include<conio. } } } y: if(c==l2) printf("\n\t\tWord Found").&c).j).c.r.j=0. } } } t=a[1][1].smallest.i++) { for(j=1.i.

} if(z==(r*c)) { smallest=t. scanf("%d".i++) { for(j=1.n<=c.j<=c.z[10][10].m.h> #include<conio. for(i=1.n.i++) { for(j=1.j++) { printf("a[%d][%d]=".j.&r.i<=r. getch().&a[i][j]). } } for(m=1.i.m++) { for(n=1.b[10][10].h> void main() { int r. } else { z++.c. scanf("%d%d".n++) .largest). clrscr().m<=r.j).j<=c. #include<stdio. } C Program For Matrix addition.j++) { if(smallest>a[i][j]) { smallest=a[i][j].i.&c). for(i=1. } } } printf("largest elemement=%d\n". printf("Enter r and c value:").a[1][1]=smallest. printf("smallest element=%d\n".a[10][10].i<=r.smallest).

} printf("\n"). } C Program For ARMSTRONG NUMBER. } getch().i++) { for(j=1. printf("Enter the n value:").j<=c.{ printf("b[%d][%d]=". } } // z[i][j]=0. scanf("%d".h> #include<conio.s=0.m. } if(k==s) { printf("given %d is armstrong number".h> void main() { int n. s=s+t*t*t.i++) { for(j=1.j<=c.j++) { z[i][j]=(a[i][j]+b[i][j]). #include<stdio.k). while(n>0) { t=n%10. clrscr().&k).i<=r. scanf("%d".i<=r.j++) { printf("%d\t". n=k. n=n/10.k. for(i=1.n). } } for(i=1. } .z[i][j]).t.&b[m][n]).

} C Program For FINDING ONE DIMENSIONAL ARRAY BIG AND SMALL ELEMENT. getch().min).i<=n.max). } .max.i<=n.i).i++) { if(a[i]>max) { max=a[i]. for(i=1. printf("minimum is=%d".h> void main() { int n.min. scanf("%d". } getch(). scanf("%d". } max=0.i.a[10].&a[i]). } } printf("maximum is =%d".i++) { printf("Enter the a[%d]=". printf("Enter the n value").else { printf("not armstrong number").&n). clrscr(). #include<stdio. for(i=1.h> #include<conio. } if(a[i]<min) { min=a[i].

i. scanf("%d".i<=n. for(i=2. } .&a[i]).i. a[1]=1. #include<stdio. } getch(). #include<stdio.h> #include<conio. printf("Enter the n value:").i++) { printf("enter the a[%d]=".&n).a[i]). } getch(). printf("%d\n".h> void main() { int a[20]. } for(i=n.C Program For FIBINACCI SERIES USING ARRAY. printf("Enter the n value"). scanf("%d". printf("%d\n".i>0.&n).n. printf("%d\n".h> void main() { int n. scanf("%d". clrscr(). a[0]=0.i--) { printf("%d\n".a[1]).h> #include<conio.a[i]).i).a[20].i++) { a[i]=a[i-1]+a[i-2]. } C Program For ARRAY REVERSE. for(i=1. clrscr().i<n.a[0]).

C Program For ASCII VALUE. #include<stdio. t=t+1.i<=n.&n). scanf("%d".i).mid. scanf("%d".h> void main() { int t.f=0.high. scanf("%d". n=n/10. #include<stdio. printf("Enter the n value:").n.t).h> #include<conio.i. printf("%c\n". high=n. printf("Enter the password"). } getch(). } C Program For BINARY SEARCH.t).h> #include<conio.low.&search). scanf("%d". //printf("%d\n". for(i=1. .&a[i]).&n). low=1. clrscr(). while(n>0) { t=n%10. } printf("Enter the search element:").k.a[20].search.h> void main() { int n. while(low<=high) { mid=(low+high)/2. clrscr().i++) { printf("Enter the number in ascending order a[%d]=".

j<=c. } } for(i=1.i++) { for(j=1. } else { f=1.h> void main() { int i.if(search<a[mid]) { high=mid-1.j.i.&a[i][j]).j++) { printf("a[%d][%d]=". scanf("%d". printf("obtainedin the position %d:".mid).r.i++) { for(j=1. } C Program For SUM OF DIAGONAL ELEMENTS IN MATRIX. getch(). for(i=1.j<=c. } else if(search>a[mid]) { low=mid+1.j).z=0. scanf("%d%d".i<=r.&r. } getch(). } } if(f==0) { printf("not present").j++) { . clrscr().&c).i<=r. printf("Enter the r and c").c. #include<stdio. exit().h> #include<conio.a[10][10].

c.j<=c.j<=c.i<=r. } for(i=1.j++) { if(i==j) { z=z+a[i][j].i++) { for(j=1. clrscr().&c). } printf("\n\n").j).i<=r.i.j++) { printf("%d".h> void main() { int i. } } for(i=1.j.&r.a[i][j]). getch(). } printf("\n"). #include<stdio.a[i][j]).z).r.a[10][10]. } C Program For TRANSPOSE MATRIX.j<=c. scanf("%d%d". for(i=1.&a[i][j]).h> #include<conio.printf("%d". . } printf("\n").i<=r.i++) { for(j=1.i++) { for(j=1. } } } printf("sum of digonal elements=%d". printf("Enter r and c value:"). scanf("%d".j++) { printf("a[%d][%d]=".

i++) { t=t*10+a[i]. } C Program For MAKING NUMBER SERIES . } getch(). } .&a[i]).h> #include<conio. for(i=1. scanf("%d".n.i<=n.h> void main() { int i. printf("Enter the n value"). } printf("\n").a[j][i]).t).&n).if(r==c) { printf("transpose matrix"). } for(i=1.j++) { printf("%d".t=0.j<=r. #include<stdio. } } else { printf("not possible"). for(i=1. clrscr().i<=c.i++) { printf("Enter the a[%d]=". getch().i++) { for(j=1. printf("\n").i).a[10].i<=n. scanf("%d". } printf("the series is=%d".

h> #include<conio.i++) { for(j=i+1. } getch().&n).t.j++) { if(a[i]>a[j]) { t=a[i]. a[z]=t.j.i<=z.i<=z.z=1.i++) { printf("%d". scanf("%d". . a[j]=t.j<=z. a[i]=a[j]. } } } for(i=2. z++. } for(i=1.C Program For ORDER OF NUMBERS. /* N=321 AND RESULT=123*/ #include<stdio. while(n>0) { t=n%10. n=n/10. clrscr().h> void main() { int n.a[i]).a[20]. printf("Enter any number:"). } C Program For PALINDROME OF NUMBER.i.

n. } getch(). n=n/10.h> #include<conio.t.n.i.i<n. clrscr(). n=k.&n). while(n>0) { t=n%10. scanf("%d". } C Program For PERFECT NUMBER.s=0. scanf("%d". clrscr().h> void main() { int c=0.h> #include<conio. } } if(n==c) { . printf("Enter the n value:"). #include<stdio.<br> printf("Enter n value:"). for(i=1. s=s*10+t.&k).#include<stdio. } else { printf("not palindrome"). } if(k==s) { printf("given %d number is palindrome".h> void main() { int k.i++) { if(n%i==0) { c=c+i.k).

j.i. scanf("%d%d".&b).c).i++) { c=0.h> void main() { int i.h> .n.a. #include<stdio.c). for(j=1.j.h> #include<conio. } } getch(). for(i=a. //printf("i=%d and j=%d and c=%d\n".&a. clrscr().h> #include<conio.j++) { if(i%j==0) { c++.i<=b.i).j<=i.b. } getch(). } PRIME NUMBER FINDING #include<stdio.printf("given number %d is perfect number". printf("Enter any number:").c=0. } else { printf("not perfect number"). } } if(c==2) { printf("%d\n". } C Program For UPPER TRIANGULAR MATRIX.

for(i=1. } // printf("\n").&c).&r. for(j=1. scanf("%d".void main() { int i. scanf("%d%d".j.j<=c.j).j<=c.i<=r.&a[i][j]).r. for(i=1.c.j++) { if(i>=j) { printf("%d". } printf("\n"). } else { printf("\t"). clrscr().j<=c.i++) { printf("\n").j++) { printf("%d".a[10][10].i++) { for(j=1.i.j++) { printf("a[%d][%d]=".i<=r.a[i][j]).i++) { for(j=1.i++) { printf("\n").a[i][j]). printf("Enter the r and c value:").j<=c. } for(i=1. for(j=1. } } printf("\n\n").i<=r.i<=r.j++) { if(j>=i) { . for(i=1. } } printf("given matrix").

b).&n).b).b. #include<stdio. printf("%d %d". } C Program For SWAPPING VALUES.h> void main() { int a. printf("Enter the digit"). b=a-b. scanf("%d".a.a.printf("%d". a=a-b. clrscr().h> void main() { int n.&b). } // printf("\n"). while(n>0) { . scanf("%d%d".&a. getch(). printf("%d %d". } C Program For SUM OF DIGITS.t. } } getch(). } else { //printf("\t").s=0. printf("Enter the a and b value"). clrscr(). a=a+b.h> #include<conio. #include<stdio.h> #include<conio.a[i][j]).

a[20].h> void main() { int r. clrscr(). printf("Enter the n value:").c=0. while(a<=r)//for(i=1.i++) { b=1. #include<stdio. s=s+t. .s).b.n. } getch(). } printf("sum =%d". n=n/10.z=1.h> #include<conio. } C Program For PRIME SERIES. a++.m. }//end of while if(c==2) printf("%d".k. while(b<=a) { if(a%b==0) c=c+1. } C Program For DUPLICATE ELIMNATION.&r).b[20].c=0.a).t=n%10.a.j. #include<stdio. scanf("%d". getch(). a=1.h> #include<conio.h> void main() { int i.i<=n. b++.

} } } for(k=1. for(i=1. z++.t.h> #include<conio.i++) { . } } for(m=1. printf("Enter the n value:").m=1.i<=n. scanf("%d".b[m]).i<=n. #include<stdio.j. scanf("%d".&a[i]).h> void main() { int i.clrscr(). for(i=1. printf("Enter the n value:").n.i++) { for(j=i+1. } C Program For INSERTION SORTING.m<z.k++) { if(a[k]!=0) { b[z]=a[k].i). scanf("%d".&n).&n). } for(i=1.i++) { printf(" a[%d]=".j++) { if(a[i]==a[j]) { a[j]=0.k<=n. clrscr().i<=n. } getch().m++) { printf("%d\n".a[20].j<=n.

i--) { printf("%d\n".t.a[20]. } for(i=n.j++) { t=a[i]. printf("Enter the n value:"). #include<stdio. clrscr().h> #include<conio.printf("a[%d]=".i<=n. } getch().i>0. } for(i=1. scanf("%d". scanf("%d".j. a[j]=t. .&a[i]). for(i=1.i. } } m++.h> void main() { int n.j<=n.i++) { for(j=i+1.&a[i]).j++) { if(a[i]>=a[j]) { t=a[i].i++) { printf("a[%d]=".j<=i. } for(i=1.a[i]).i).&n).i++) { for(j=1. scanf("%d". if(a[i]>a[j]) { a[m]=a[j]. } C Program For BUBBLE SORTING.i).i<=n.i<=n.

h> #include<conio. #include<stdio. } getch().a[i]). } getch().i. a[j]=t. } C Program For DECIMAL TO BINARY.z=0.&n).a[i]). z++. clrscr(). #include<stdio.i--) { printf("%d".i>=0. } C Program For BINARY TO DECIMAL.h> #include<math.i++) { printf("%d\n". } for(i=z.h> #include<conio.h> void main() . } } } for(i=1. printf("Enter the n value").a[20]. while(n>0) { a[z]=n%2.a[i]=a[j].h> void main() { int n. n=n/2.h> #include<math.i<=n. scanf("%d".

scanf("%d%d".&n.z++)).t.s). printf("Enter the n value"). printf("the ncr =%d\n". } C Program For FINDING POWER VALUE OF GIVEN NUMBER. printf("r=%d\n". getch(). . printf("n-r=%d\n". while(n>0) { t=n%10. } printf("given number is=%d".h> #include<conio.fact(n)).n. getch().r. printf("n=%d\n".z=0. } C Program For NCR VALUE BY RECURSIVE FUNCTION. printf("s=%d\n". scanf("%d".s).fact(r)). s=s+(t*pow(2.ncr). clrscr().h> void main() { int n. clrscr(). printf("Enter the n and r value:"). } return(c).i<=a. n=n/10.i++) { c=c*i.fact(n-r)). for(i=1.ncr.&n).&r). ncr=fact(n)/((fact(r))*(fact(n-r))).{ int s=0. } int fact(int a) { int c=1.i. #include<stdio.

printf("factorial value is=%d". //printf("%d\n".&n).i++) { c=c*n. getch(). scanf("%d". f=fact(n). } printf("the power value is=%d".f).#include<stdio. clrscr().c). scanf("%d". for(i=1.c).c=1. printf("Enter the n value:").h> #include<conio.i. printf("Enter the n value:").&n).h> void main() { int n. #include<stdio.f.h> void main() { int n. } C Program For FACTORIAL USING RECURSION.h> #include<conio. printf("Enter the r value:").i<=r. } int fact(int a) { int c=1. if(a==1) { return(1).&r).r. clrscr(). return (a). getch(). scanf("%d". . } else { a=a*fact(a-1).

i).} } C Program For SELECTION SORTING. for(i=1. } i=1. if(a[i]>a[j]) { a[i]=a[j].&a[i]).j<=n. scanf("%d".i.j. } } i++. printf("Enter the n value:").i++) { printf("a[%d]=". } for(i=1.j++) { z=a[i].i++) { printf("%d\n". } .i<=n. } getch().&n). a[j]=z. clrscr(). #include<stdio. while(i<=n) { for(j=i+1.a[i]).i<=n.h> #include<conio.a[20].z. scanf("%d".h> void main() { int n.

} if(n==1) { return(1). scanf("%d". } int fib(int n) { if(n==0) { return(0). } getch().i++) { printf("%d\n". printf("the fibinacci series is\n").C Program For FIBANACCI SERIES USING RECURSION.i<n. #include<stdio.h> #include<conio. for(i=0.h> void main() { int i.n. } else { return(fib(n-1)+fib(n-2)). printf("Enter the n value:").fib(i)). } } .&n). clrscr().