Showing posts with label C PROGRAM. Show all posts
Showing posts with label C PROGRAM. Show all posts

Thursday, November 22, 2012

C PROGRAM FOR REPLACING STRING

/* C PROGRAM FOR  REPLACING STRING*/ #include<stdio.h> #include<conio.h> #include<string.h>  void main()  {           int slen,sublen,newlen,reslen,m,k,i,j,temp;           char str[40],substr[20],newstr[20],resstr[25];           clrscr();           printf("\n\t\t STRING REPLACING");           printf("\n\t\t...

C PROGRAM FOR SALES REPORT

/*  C PROGRAM FOR  SALES REPORT */ #include<stdio.h> #include<conio.h> #include<string.h> void main() {      int sal[5][5],s,p,i,j,row,col,temp,per,avg;      char s_men[10][30],pr[10][30],waste[33];      clrscr();      printf("\n\t\t SALES REPORT");      printf("\n\t\t -------------");      printf("Enter how many salesman:");      scanf("%d",&s);     ...

C PROGRAM FOR BOOK SEARCHING AND SORTING

/* C PROGRAM FOR BOOK SEARCHING AND SORTING*/ #include<stdio.h> #include<conio.h> #include<string.h> void newentry(); void sort(); void search(); void list(); struct books {     char authname[50];     char title[50]; }b[10]; int c=1; void main() { int k,i,ch,n; char w[30]; clrscr(); printf("\n\t\t\tBOOK OPERATION\n"); printf("\n\t\t\t--------------\n"); printf("\nEnter how many book you want to enter:"); scanf("%d",&n); for(i=0;i<n;i++) newentry(); while(1) {  clrscr();  printf("\nMain...

C PROGRAM FOR BANK OPERATION USING FUNCTIONS

/* C PROGRAM FOR  BANK OPERATION USING FUNCTIONS*/ #include<stdio.h> #include<conio.h> int amt=10000,b,w,d,n; void deposit() {      printf("Enter amount\n");      scanf("%d",&d);      amt=amt+d;      printf("Your amount is:%d\n",amt);  } void withdraw() {      printf("Enter amount\n");      scanf("%d",&w);      if(amt>=100)      {       amt=amt-w;       printf("Your...

C PROGRAM FOR STUDENTS MARKSHEET USING STRUCTURES

/*  C PROGRAM FOR STUDENTS MARKSHEET USING STRUCTURES */ #include<stdio.h> #include<conio.h> struct stu {       int rn,grade,a[5];       float avg;   }s[2]; void main() {       int i,j,sum,n;       float avg;       clrscr();       printf("\t STUDENT MARKSHEET USING STRUCTURES\n\n");       printf("Enter the no of students");       scanf("%d",&n); for(i=0;i<n;i++) {       scanf("%d",s[i].rn); for(j=0;j<=5;j++) {       scanf("%d",&s[i].a[j]);   ...

C PROGRAM FOR TOWERS OF HANOI

/* C PROGRAM FOR  TOWERS OF HANOI */ #include<stdio.h> #include<conio.h> void transfer(int t,char,char,char); void main() {       int n;       clrscr();       printf("\n\n\t\t TOWERS OF HANOI");       printf("\n\n\t\t ~~~~~~~~~~~~~~~~");       printf("\n\n Enter the no of disk:");       scanf("%d",&n);       transfer(n,'l','r','c');       getch();  ...

C PROGRAM FOR PRIME NUMBER GENERATION

/* C PROGRAM FOR  PRIME NUMBER GENERATION */ #include<stdio.h> #include<conio.h> void main() {              int a,b,c=0,r;  clrscr();              printf("\n\t\tPRIME NUMBER");              printf("\n\t\t~~~~~~~~~~~~~");              printf("\nEnter range:");       ...

C PROGRAM FOR ARMSTRONG NUMBER

/*  C PROGRAM FOR  ARMSTRONG NUMBER */ #include<stdio.h> #include<conio.h> #include<math.h> void main() {      int s,x,i,n;      clrscr();      printf("\n\t\tARMSTRONG NUMBER");      printf("\n\t\t~~~~~~~~~~~~~~~~");      printf("Armstrong no's are\n");        for(i=100;i<=1000;i++)       {          s=0;    ...