MAP

Showing posts with label GTU MCA 1ST SEMESTER. Show all posts
Showing posts with label GTU MCA 1ST SEMESTER. Show all posts

gtu papers | GTU MCA Exam Papers | GTU M.C.A 1st Semester - 2nd Semster - 3rd Semester | GTU Exam papers | Gujarat Technological University Exam papers

MCA  -   NOV - DEC10 & JAN-11
MCA  - I (REG/REM)
29-01-2011 610001
31-01-2011 610003
01-02-2011 610004
02-02-2011 610005
03-02-2011 610007
MCA  - II (REM)
16-12-2010 620001
18-12-2010 620003
20-12-2010 620005
21-12-2010 620006
22-12-2010 620007
MCA  - III (REG)
03-01-2011 630001
04-01-2011 630002
05-01-2011 630003
06-01-2011 630004
07-01-2011 630005

GTU MCA 1st Semester Syllabus | GTU MCA Syllabus | Syllabus - Gujarat Technological University | GTU New MCA Syllabus

MCA SEM - 1
Fundamental of Programming610001Download
Programming Skill - I (FOP)610002Download
Descreate Maths for Computer Science610003Download
Fundamental of Computer Organization610004Download
Database Management System - I610005Download
Software Lab (SQL & PLSQL)610006Download
Enterprise Resources and Financial Management610007Download

Result - Gujarat Technological University | GTU RESULT | Exam Results 2011, India Results, University Results | GTU Result 2011 - ME, BE, MCA ,MBA,PDDC,ME,GCET,DIPLOMA


05-09-11
Result of MCA SEM 2 - Regular (JUN 2011) Exam
05-09-11 Result of MCA SEM 2 - Remedial (JUN 2011) Exam
02-09-11 Result of PDDC SEM 2 - Regular (JUL 2011) Exam
02-09-11 Result of PDDC SEM 2 - Remedial (JUL 2011) Exam
02-09-11 Result of ME SEM 1 - Remedial (JUN 2011) Exam
30-08-11 Result of MBA SEM 1 - Remedial (JUN 2011) Exam
30-08-11 Result of MCA SEM 1 - Remedial (JUN 2011) Exam
30-08-11 Result of MPH SEM 2 - Regular (JUN 2011) Exam
27-08-11 Result of HM SEM 2 - Regular (JUN 2011) Exam
27-08-11 Result of HM SEM 2 - Remedial (JUN 2011) Exam
27-08-11 Result of HM SEM 3 - Regular (JUN 2011) Exam
25-08-11 Result of M.Pharm SEM 4 - Regular (JUN 2011) Exam
 24-08-11 Result of MBA SEM 3(EVE) - Regular (MAY 2011) Exam
24-08-11 Result of MBA SEM 2 - Regular (MAY 2011) Exam
24-08-11 Result of MBA SEM 2 - Remedial (MAY 2011) Exam
18-08-11 Result of BP SEM 1 - Remedial (JUL 2011) Exam
18-08-11 Result of BP SEM 2 - Regular (JUL 2011) Exam
18-08-11 Result of BP SEM 2 - Remedial (JUL 2011) Exam
16-08-11 Result of BE SEM 4 - Regular (JUN 2011) Exam
16-08-11 Result of BE SEM 4 - Remedial (JUN 2011) Exam
11-08-11 Result of DIPL SEM 2 - Remedial (JUN 2011) Exam - Only for those student who have appeared in Diploma Sem - VI Exam
11-08-11 Result of DPH Year 1 - Regular (JUN 2011) Exam
11-08-11 Result of ME SEM 4 - Regular (MAY 2011) Exam
11-08-11 Result of MBA SEM 3 - Remedial (JUN 2011) Exam
10-08-11 Result of BE SEM 5 - Remedial (JUN 2011) Exam
08-08-11 Know your STPI : Semester Theory Performance Index
08-08-11 Result of PDDC SEM 4 - Regular (JUN 2011) Exam
05-08-11 Result of PDDC SEM 1 - Remedial (JUN 2011) Exam
05-08-11 Result of BPH SEM 4 - Regular (JUN 2011) Exam
05-08-11 Result of BPH SEM 4 - Remedial (JUN 2011) Exam
05-08-11 Result of BPH SEM 5 - Remedial (JUN 2011) Exam
29-07-11 Result of BE SEM - 3 - Remedial (MAY 2011) Exam
28-07-11 Result of DP Year 2 - Regular (JUN 2011) Exam
28-07-11 Re-checking Result of Diploma Pharmacy-Year-1 (Remedial Exam-April 2011)
25-07-11 Result of MBA Sem -4  Regular (May-2011) Exam
21-07-11 Result of B.E Sem -6 Regular (May-2011) Exam
21-07-11 Result of M.E Sem -3 Remedial (June-2011) Exam
21-07-11 GCET - 2011 (Provisional Rank) Mock round - 1 Result
GCET - 2011 (Provisional Rank) Mock round - 1 Result - [Alternate link]
20-07-11 Result of DIPL Sem -5 Remedial (June-2011) Exam [Re-checking / Reassessment]
20-07-11 Result of MCA Sem -3 Remedial (June-2011) Exam
20-07-11 Result of M.Pharm Sem -1 Remedial (June-2011) Exam
16-07-11 Change in Grade Due to Mid Internal mark Update
15-07-11 Diploma engineering sem – VI Rechecking/ Reassessment Result
13-07-11 Result of Diploma Sem -4 Remedial (June-2011) Exam
12-07-11 Change in Grade Due to Mid Internal mark Update
11-07-11 Result of Diploma Sem -5 Remedial (June-2011) Exam
11-07-11 Result of Diploma Sem -3 Remedial (May-2011) Exam
09-07-11 Result of BPH SEM - 3 Remedial (May - 2011) Exam
08-07-11 Change in Grade Due to Mid - Internal Mark Update
07-07-11 Result of BPH SEM - 6 Regular (May - 2011) Exam
07-07-11 Result of MCA SEM - 4 Regular (May - 2011) Exam
30-06-11 Result of Diploma SEM  - 6 - Regular (June-2011) Exam
10-06-11 Result of Diploma SEM  - 6 - Architectural Assistantship - Regular (June-2011) Exam
24-05-11 Result of DPH SEM 1 - Remedial (APR 2011) Exam
23-05-11 Rechecking Result BE SEM - I - GRADE CHANGE
12-05-11 Rechecking Result Diploma SEM - I - GRADE CHANGE
10-05-11 Rechecking Result B.E SEM -V - GRADE CHANGE
10-05-11 Rechecking Result B.E SEM -III - GRADE CHANGE
10-05-11 Rechecking / Re-Assessment Result Diploma SEM -V - GRADE CHANGE
10-05-11 Rechecking Result Diploma SEM -III - GRADE CHANGE
10-05-11 Rechecking Result B.Pharm SEM -I - GRADE CHANGE
09-05-11 Rechecking /Re-assessment Result ME SEM -I - GRADE CHANGE
09-05-11 Rechecking /Re-assessment Result MCA SEM -III - GRADE CHANGE
09-05-11 Rechecking /Re-assessment Result MCA SEM -I - GRADE CHANGE
09-05-11 Rechecking /Re-assessment Result M.Pharm SEM -I - GRADE CHANGE
09-05-11 Rechecking / Re-assessment Result ME SEM-II - NO GRADE CHANGE
SOURCE WWW.GTU.AC.IN

SYLLABUS | MCA 1st SEMESTER | 610003-Discrete Mathematics for Computer Science | MATHEMATICS

Objectives:  
The objective of this course is to present the foundations of many basic
computer related concepts and provide a coherent development to the students for the
courses like Fundamentals of Computer Organization, RDBMS, Data Structures,
Analysis of Algorithms, Theory of Computation ,Cryptography, Artificial Intelligence
and others. This course will enhance the student’s ability to think logically and
mathematically.


Prerequisites: 

Knowledge of basic concepts on Sets, different operations on sets,
binary operations, functions.
 

Contents:
1. Mathematical Logic : Introduction, Connectives, statement formulas, principle of
substitution, validity of arguments, Quantifiers, Proof techniques.


2. Lattices and Boolean Algebra : Relation and ordering, partially ordered sets,
Lattices as poset, properties of lattices, Lattices as algebraic systems, sublattices,
direct product and homomorphism, complete lattices, bounds of lattices, distributive
lattice, complemented lattices.
Introduction, definition and important properties of Boolean Algebra, Sub Boolean
algebra, direct product and homomorphism, join-irreducible, meet-irreducible,
atoms, anti atoms, Stone’s representation theorem. (Without Proof),
Note : No proof is required for Theorems or Results on lattices and Boolean
Algebra. Theorems should be justified and explained by suitable examples .


3. Applications of Boolean Algebra : Boolean expressions and their equivalence,
Minterms and Maxterms, Free Boolean algebra, Values of Boolean expression,
canonical forms, Boolean functions, representation of Boolean function, Karnaugh
maps, minimization of Boolean function, Quine_ Mccluskey algorithm, Application
to Relational Database.


4. Group Theory : Definition and examples of groups, abelian group, cyclic groups,
permutation groups, subgroups & Homomorphism, Cosets and Lagrange’s Theorem
(without proof), Normal subgroups, Quotient Groups.


5. Graph Theory : Basic concepts of Graph theory, paths, reachability and
connectedness, matrix representation of graph, trees.


Main Reference Books :
1. “Discrete Mathematical Structures with Applications to Computer Science”, J. P.
Tremblay and R.Manohar ,Tata McGraw-Hill
2. “Discrete Mathematical Structure”, D. S. Malik, M. K. Sen, Cengage Learning
 

Suggested Additional Reading :
1. Discrete Mathematics and its applications, Tata McGraw-Hill, 6th edition, K. H. Rosen.
          2. Discrete Mathematical Structure, Pearson Education, Bernard Kolmann& others, Sixth Edition
      3. Discrete Mathematics with Graph Theory, PHI, Edgar G. Goodaire, Michael M. Parmenter.
     4. Logic and Discrete Mathematics, Pearson Education, J. P. Tremblay and W. K. Grassman.
 

Chapter wise coverage from the main reference books:
 

1. From Book # 1
 
Chapter – 2, article 2-3 (2-3.1 to 2-3.9)
                            Chapter-3, article 3-5 (3-5.1 to 3-5.4) upto Theorem 3-5.8                                   Chapter – 4, articles 4-1 to 4-4
  Chapter – 5, article 5-1 (5-1.1 to 5-1.4)
 

2. From Book # 2
Chapter – 1, articles 1.2 to 1.5
Chapter-3 article 3.3


Accomplishment of the student after completing the course : The student will be able to apply concepts to RDBMS, perform minimization of Boolean
functions, shall learn the fundamentals representations methods of graphs and trees. They
shall be able to use different logical reasoning to prove theorems.

FOP MATERIAL | 100 - C language programms

‘C’ LANGUAGE PROGRAMMING PART

            PROG – 1   SIMPLE PROG TO DISPLAY YOUR NAME.

            #inlcude<stdio.h>
            #include<conio.h>
            void main()
{                     
            printf(“my name is chetan”);
            getch();
}         
           
            output : my name is chetan
           
            ------------------------------------------------------------------------------------------------------------------------------
            PROG 2 –TO FIND OUT THE REDIUS FOR CIRCLE

            #include <stdio.h>
#include <conio.h>
#define pi 3.14
void main()
{
            float r,a,cir;
            clrscr();
             printf(" Enter the Redius for circle");
            scanf("%f",&r);
             printf("\n\nArea of Circle is : %f",pi*r*r);
            printf("\n\n Circumference of the Circle is : %f",2*pi*r);
            getch();
}


OUTPUT : DEPEND ON THE VALUE YOU ENTER




PROG -3 /* Read an integer to sore hours & convert into days and hrs.*/

#include<stdio.h>
#include<conio.h>
void main()
{
int num,w,yr,d;
clrscr();
printf(" enter number: ");
scanf("%d",&num);
yr=num/365;
w=(num%365)/7;
d=(num%365)%7;
printf("\nYear is :=%d",yr);
printf("\nWeek is :=%d",w);
printf("\nDay is  := %d",d);
getch();
}
           
            OUTPUT : DEPENDS ON THE NUMBER YOU ENTER
            ------------------------------------------------------------------------------------------------------------------------------

PROG-  4 – TO FIND OUT TOTAL MARKS AND PERCENTAGE

#include<stdio.h>
#include<conio.h>
void main()
{
            int n1,n2,n3,n4,n5,tot,per;
            clrscr();
            printf("enter mark1  ");
            scanf("%d", &n1);
            printf("enter mark2  ");
            scanf("%d", &n2);
            printf("enter mark3  ");
            scanf("%d", &n3);
            printf("enter mark4  ");
            scanf("%d", &n4);
            printf("enter mark5  ");
            scanf("%d", &n5);
            tot=n1+n2+n3+n4+n5;
            per=tot/5;
            printf("the total marks from 500 is= %d", tot);
            printf("\n");
            printf("percent is= %d", per);
            getch();
}


output:
enter mark1  45
enter mark2  46
enter mark3  38
enter mark4  98
enter mark5  74
the total marks from 500 is= 301
percent is= 60
            ------------------------------------------------------------------------------------------------------------------------------

PROG-5 Prog for factorial recursion

#include<stdio.h>
#include<conio.h>
void main()

             {
            int res;
            res=rec(5);
            clrscr();
            printf("\n The fact recursion is  %d",res);
            getch();
            }
            int rec (int n)
            {
            int f=1;
            if (n==1)
            return(1);
            else
            f=n*rec(n-1);
            return (f);
             }

output:   The fact recursion is  120

------------------------------------------------------------------------------------------------------------------------------


Prog 6 prog for count salary

# include <stdio.h>
# include <conio.h>
void main()
{
            int bs,da,hra;
            clrscr();
            printf("Enter Basic Salary :");
            scanf("%d",&bs);
            if(bs<=1500)
            {
            da=bs*0.9;
            hra=bs*0.1;
            bs=bs+da+hra;
            }
            else if(bs>1500)
            {
            hra=500;
            da=bs*0.98;
            bs=bs+da+hra;
            }
            printf("TOTAL GROSS SALARY IS : %d",bs);
            getch();
}

output:
Enter Basic Salary :2000
TOTAL GROSS SALARY IS : 4459







Prog 7: prog for count persentage

#include<stdio.h>
#include<conio.h>
void main()
 {
            float n1,n2,n3;
            clrscr();

            printf("enter n1  ");
            scanf("%f", &n1);
            printf("enter n2  ");
            scanf("%f", &n2);
            printf("enter n3  ");
            scanf("%f", &n3);
            if (n1+n2>n3)
{
            printf("valid tringle");
}
            else if (n2+n3>n1)
            printf("valid tringle");
            else if(n3+n1>n2)
            printf("valid tringle");
            getch();
}


output
enter n1  3
enter n2  4
enter n3  5
valid tringle
------------------------------------------------------------------------------------------------------------------------------








Prog 8 :prog for leap year

 #include<stdio.h>
 #include<conio.h>
 void main()
 {

            int y,lp;
            clrscr();
            printf ("enter year   ");
 scanf("%d",&y);
            if (y%4==0)
{
            printf("leap year");
}         
            else
            printf("not leap year");
            getch();
}

output:
enter year   2004
leap year
------------------------------------------------------------------------------------------------------------------------------
                       
Prog 9 :TO FIND OUT MAXIMUM NUMBER

#include <stdio.h>
#include <conio.h>
            void main()
{
            int n1,n2,max;
            clrscr();
            printf("enter n1   ");
            scanf("%d", &n1);
            printf("enter n2   ");
            scanf("%d", &n2);
            if (n1 >= n2)
{
            max=n1;
            printf("the  max no is number %d",max);
}
            else
{
max=n2;
            printf("the max no is number %d", max);
}
            getch();
}


output:
enter n1   34
enter n2   32
the  max no is number 34
------------------------------------------------------------------------------------------------------------------------------

prog 10: prog for whether the number is odd or even.
           
# include <stdio.h>
# include <conio.h>
void main()
{
            int a;
            clrscr();
            printf("Enter no. :");
            scanf("%d",&a);
            if(a%2==0)
            {
            printf("no is even");
            }
            else
            {
            printf("no is odd");
            }
            getch();
}


OUTPUT : DEPEND ON THE NUMBER YOU ENTER


Prog11 : Prog to find total cost

#include<stdio.h>
#include<conio.h>
void main()
 {
            int qty;
            float price,cost,dis;
            clrscr();
            printf("enter qty   ");
            scanf("%d", &qty);
            printf("enter price   ");
            scanf("%f",&price);
            cost=price * qty;
            if (cost >= 1000)
{
dis= price * qty * 0.1;
            cost= (price*qty) - dis;
            printf("the total cost is  : %f", cost);
            }
            else
            {
            cost=price*qty;
            printf("%f", cost);
            }
            getch();
 }

OUTPUT : DEPEND ON THE QTY YOU ENTER
------------------------------------------------------------------------------------------------------------------------------

Prog 12 : This programme is to find middle value from given three values using  logical operators.

# include <stdio.h>
# include <conio.h>
main()
{
             int a,b,c;
             clrscr();
             printf("\n Enter the value of A : ");
             scanf("%d",&a);
             printf("\n Enter the value of B : ");
             scanf("%d",&b);
             printf("\n Enter the value of C : ");
             scanf("%d",&c);
             if (((a>b) && (a<c)) || ((a<b) && (a>c)))
            printf("\n Middle value is %d",a);
             if (((b>a) && (b<c)) || ((b<a) && (b>c)))
            printf("\n Middle value is %d",b);
             if (((c>a) && (c<b)) || ((c<a) && (c>b)))
            printf("\n Middle value is %d",c);
             getch();
             return 0;
}

OUTPUT : DIPLAY THE MIDDLE VALUE
------------------------------------------------------------------------------------------------------------------------------
PROG 13: TO FIND OUT SALARY + HRA +DA
#include<stdio.h>
#include<conio.h>
void main()
{
            int sal,da,hra;
            clrscr();
            printf("enter salary  ");
            scanf("%d",&sal);
            if (sal<=1500)
            {
            hra=sal*0.1;
            da= sal*0.9;
            }
            else
            {
            hra=500;
            da=sal*0.9;
            }
            printf("basic salary is = %d", sal,da,hra);
            printf("\n the total salary is = %d", sal+da+hra);
            getch();
}

OUTPUT : DISPLAY THE BASIC SALARY
Prog14 : prog  to count length of string

#include<stdio.h>
#include<conio.h>
void main()
            {         
     char arr[50];
            Int len1;
clrscr();
printf("enter the string  ",arr);
scanf("%s",arr);
gets(arr);
len1 = strlen (arr);
printf ("\n string = %s length = %d", arr,len1);
           getch();
           }

output:
enter the string  mayur
             string = mayur length = 5
            ------------------------------------------------------------------------------------------------------------------------------

prog 15 :prog for define capital,small or digit

#include<stdio.h>
#include<conio.h>
void main()
{
            char a;
            clrscr();
            printf ("enter any key   ");
            scanf ("%c", &a);
            if (a>=65 && a<=90)
{
            Printf("the result is capital alphbet %c", a);
}
            else if (a>=97 && a<=122)
            printf ("small alpha %c",a);
            else if (a>=48 && a<=57)
            printf ("digit %c",a);

            getch();
}

           
output
enter any key   G
the result is capital alphbet G
------------------------------------------------------------------------------------------------------------------------------

Prog 16 : prog for a counting string

#include<stdio.h>
#include<conio.h>
void main()
{
   char str[8];
   int j=0;
 strlen j();
              clrscr();
   printf("\n Enter the string   ");
   scanf("\n %s",str);
      j=strlen(str);
   printf("The length is %d",j);
               getch();
 }
           
 output
 Enter the string   abc
 The length is 3

------------------------------------------------------------------------------------------------------------------------------

Prog 17 : prog for whether the insurance is given or not
           
# include <stdio.h>
# include <conio.h>
# include <string.h>
void main()
{
            char st[6];
            char s[5];
            int a;
            clrscr();
            printf("Enter status: ");
            scanf("%s",&st);
            printf("Enter sex: ");
            scanf("%s",&s);
            printf("Enter age: ");
            scanf("%d",&a);
            if(strcmp(st,"u")==0 && strcmp(s,"m")==0 && a>=30 || strcmp(s,"f")==0 && a>=25)
            {
            printf("INSURANCE IS GIVEN");
            }
            else
            {
            printf("INSURANCE IS NOT GIVEN");
            }
            getch();
}

OUTPUT : DEPEND ON THE NUMBER YOU ENTER

------------------------------------------------------------------------------------------------------------------------------

Prog 18  :// This programme is to print the prime numbers.

# include <stdio.h>
# include <conio.h>
void main()
{
             int i,j,f=0;
             clrscr();
             for(i=2; i<=100; i++)
             {
            f=0;
            for(j=2; j<=i/2; j++)
            if (i%j==0)
            {
            f=1;
            break;
            }
             if(f==0)
             printf(" %d ",i);
             }
             getch();
             return 0;        
            ------------------------------------------------------------------------------------------------------------------------------

prog 18 :// This programme is to print the series 1,4,9,16,25..... upto 100

# include <stdio.h>
# include <conio.h>
main()
           
             int i;
             clrscr();
             for(i=1; i<=10; i++)
             printf("\t %d",i*i);
             getch();
             return 0;
            }
            ------------------------------------------------------------------------------------------------------------------------------

Prog 20 : // This programme is to print the series 0,3,8,15,24.... upto 99

# include <stdio.h>
# include <conio.h>
void main()
{
             int i;
             clrscr();
             for(i=1; i<=10; i++)
             printf("\t %d",i*i-1);
             getch();
             return 0;
}
------------------------------------------------------------------------------------------------------------------------------






Prog21 : // This programme is to print the series 100,98,96,94,92........ upto 2.

# include <stdio.h>
# include <conio.h>
void main()
{
            int i;
            clrscr();
            for(i=100; i>=2; i=i-2)
            printf("\t %d",i);
            getch();
            return 0;
}
------------------------------------------------------------------------------------------------------------------------------

Prog22 :// This programme is to print the series 2,4,6,8,10...... upto 100

# include <stdio.h>
# include <conio.h>
void main()
{
            int i;
            clrscr();
            for(i=2; i<=100; i=i+2)
            printf("\t %d",i);
            getch();
            return 0;
}



Prog22 :// This programme is to print 1 to 10 in decrement order

# include <stdio.h>
# include <conio.h>
void main()
{
            int i;
            clrscr();
            for (i=10; i>=1; i--)
            printf("\n %d",i);
            getch();
            return 0;
}
------------------------------------------------------------------------------------------------------------------------------
Prog23 : // This programme is to print 1 to 10 in increment order.
# include <stdio.h>
# include <conio.h>
main()
{
            int i;
            clrscr();
            for(i=1; i<=10; i++)
            printf("\n %d",i);
            getch();
            return 0;
}
------------------------------------------------------------------------------------------------------------------------------
Prog24 : // This programme is to print the series of Armstrong numbers

# include <stdio.h>
# include <conio.h>
# include <math.h>
void main()
{
             int i,j,sum=0;
             clrscr();
             for(i=1; i<=1000; i++)
             {
            sum=0;
            for(j=i; j!=0;)
             {
            sum=sum+pow((j%10),3);
            j=j/10;
             }
            if(sum==i)
             printf("\t%d",i);
            }
             getch();
             return 0;


Prog25 : // This programme is a chart of ASCII code

# include <stdio.h>
# include <conio.h>
void main()
{
             int i;
             clrscr();
             for(i=0; i<=255; i++)
             printf("%d-> %c ",i,i);
             getch();
             return 0;
}

            ------------------------------------------------------------------------------------------------------------------------------

Prog26 : find the no which div by 13 & 7

#include<stdio.h>
#include<conio.h>
void main()
{
            int num1,num2,res,i;
            clrscr();
            printf("Enter Value of Starting Range:->");
            scanf("%d",&num1);
            printf("Enter Value of Ending Range:->");
            scanf("%d",&num2);
            printf("\n\nList of Divisable nos. by 13 and 7 both\n\n");
            for(i=num1;i<=num2;i++)
            {
            if(i%91==0) // Because 13 * 7 = 91
            printf(" %d ",i);
            }
            getch();
}





Prog27 :prog for arrange space

#include<stdio.h>
#include<conio.h>
void main()
{
            int i,j,k,sp,s=0;
            clrscr();
            for (i=5; i>=1; i--)
            {
              for(j=1; j<=i; j++)
            printf("%d ",j);
              for(sp=1;sp<s;sp=sp+1)
             { printf ("  ");
             }
              s =s+2 ;
               for (k=i;k>=1;k--)
                 if(k!=5)
       printf("%d ",k);
              printf ("\n");
                   }
                getch();
}


output:

1 2 3 4 5 4 3 2 1
1 2 3 4   4 3 2 1
1 2 3       3 2 1
1 2           2 1
1               1
------------------------------------------------------------------------------------------------------------------------------








Prog28 : prog for numbers
           
#include<stdio.h>
#include<conio.h>
void main()
{
            int n=5;
            int i,j;
            clrscr();
            printf("%d",n);
            for (i=1; i<=n; i++)
            {
            for(j=1; j<=i; j++)
            printf("%d", j);
            printf ("\n");
            }
            getch();
}

output
1
12
123
1234
12345
------------------------------------------------------------------------------------------------------------------------------

Prog29 :Prog for displaying 1…10.
                       
# include <stdio.h>
# include <conio.h>
void main()
{
            int a[10],i,temp,j;
            clrscr();
            for(i=0;i<=9;i++)
            {
            printf("\n enter value one by one :");
            scanf("%d",&a[i]);
            }
            for(i=0;i<=9;i++)
            {
            for(j=0;j<=i;j++)
            {
            if(a[i]<a[j])
            {
            temp=a[i];
            a[i]=a[j];
            a[j]=temp;
            }
            }
            }
            for(i=0;i<=9;i++)
{
            printf("\n %d",a[i]);
            }
            getch();
}
                          OUTPUT
                           1
                           2
                           3
                           4
                           5
                           6
                           7
                           8
                           9
                           10
------------------------------------------------------------------------------------------------------------------------------
Prog30 : prog for numbers

#include<stdio.h>
#include<conio.h>
void main()
            {
            int n=5;
            int i,j;
            clrscr();
            printf("%d",n);
            for (i=1; i<=n; i++)
            {
            for(j=1; j<=i; j++)
            printf("%d", j);
            printf ("\n");
            }
getch();
}

output
1
12
123
1234
12345
------------------------------------------------------------------------------------------------------------------------------
Prog31 : prog for spiral numbers
           
#include<stdio.h>
#include<conio.h>
void main()
{
            int c=2,i,j,n,k;
clrscr();
printf("enter no=  :");
 scanf("%d",&n);
 for (i=1; i<=n;i++)
             for(j=1;j<=n-i;j++)
             printf ("   ");
               for (k=j; k<=n;k++)
               {
            printf("%3d", c);
              }
            printf("\n");
              }
               getch();
            }






output
enter no=  :3

                        2
                 2  2
              2  2  2
------------------------------------------------------------------------------------------------------------------------------
Prog32 :prog for arrange space

#include<stdio.h>
#include<conio.h>
void main()
{
            int i,j,k,sp,s=0;
            clrscr();
            for (i=5; i>=1; i--)
            {
              for(j=1; j<=i; j++)
            printf("%d ",j);
              for(sp=1;sp<s;sp=sp+1)
             { printf ("  ");
             }
              s =s+2 ;
               for (k=i;k>=1;k--)
  if(k!=5)
              printf("%d ",k);
              printf ("\n");
                   }
               getch();

output:
1 2 3 4 5 4 3 2 1
1 2 3 4   4 3 2 1
1 2 3       3 2 1
1 2           2 1
1               1





Prog33 :prog for finding a no whether it is prime or not

#include<stdio.h>
#include<conio.h>
void main()     
            {
            int i=2;
            int num;
            clrscr();
            printf("enter no :-");
            scanf ("%d", &num);
            while (i<=num-1)
            {
            if (num%i==0)
            {
            printf ("not a prime number");
            getch();
            break;
            }
            i++;
             }
            if (i==num)
            {
            printf ("is a prime number");
            getch();
            }
            }

output
enter no :-17
is a prime number
------------------------------------------------------------------------------------------------------------------------------










Prog34 : Prog for  displaying number

#include<stdio.h>
#include<conio.h>
void main()
{
            int no=1;
            int ans;
            clrscr();
            while (no<=100)
{

            if (no%2==0)
            printf ("\t%d", no);
            no++;
}         
            getch();
}
------------------------------------------------------------------------------------------------------------------------------
           
Prog35 : Prog to display the 1…..99
# include <stdio.h>
# include <conio.h>
void main()
{
            int i=1,j=0;
            clrscr();
            while(j<50)
            {
            if(i%2!=0)
            {
            printf("\t %d",i);
            j++;
            }
            i++;
            }
            printf("\n %d",j);
            getch();
}
           
              OUTPUT
               1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49
               51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95
               97 99
------------------------------------------------------------------------------------------------------------------------------
prog36 : // This programme is to print the series 1,3,5,7,9..... upto 99.

# include "stdio.h"
# include "conio.h"
void main()
{
             int i;
             clrscr();
             i=1;
             while(i<=99)
             {
            printf("\t %d",i);
            i=i+2;
             }
             getch();
             return 0;
}
------------------------------------------------------------------------------------------------------------------------------
Prog37 : // This programme is to get the number in reverse manner.
# include <stdio.h>
# include <conio.h>
void main()
{
             int i,j=0;
             clrscr();
             printf("Enter the number : ");
             scanf("%d",&i);
             while(i!=0)
            {
             j=j*10+(i%10);
             i=i/10;
            }
             printf("%d",j);
             getch();
             return 0;
}
            Prog38 : // This programme is to print the series 1,2,4,7,11..... upto 10 steps.

# include <stdio.h>
# include <conio.h>
void main()
{
   int i,v,incr;
   clrscr();
   i=1;
   v=1;
   incr=1;
   while(i<=10)
   {
              printf("\t %d",v);
              i++;
              v=v+incr;
              incr=incr+1;
   }
   getch();
   return 0;
}
------------------------------------------------------------------------------------------------------------------------------
prog39 : // This programme is to print  1 t0 10 in increment order using  Do-while statement.

# include <stdio.h>
# include <conio.h>
void main()
{
   int i;
   clrscr();
   i=1;
   do
   {
             printf("\n %d",i);
             i++;
            }
   while(i<=10);
   getch();
   return 0;
   }

prog 40 :  print the reverse no

#incldue<stdio.h>
#include<conio.h>                 
void main()
{
            int no,tmpno=1;
            unsigned rev=0;
            clrscr();
            printf("\nEnter number to reverse it:->");
            scanf("%d",&no);
            tmpno=no;
            while(no>0)
            {
            rev= rev*10 + no%10;
            no /= 10;
            }
            printf("\n The reverse no is :->%u",rev);
            getch();
}
------------------------------------------------------------------------------------------------------------------------------
prog41 : print the multiplication table

#include<stdio.h>
#include<conio.h>
void main()
{
            int row,column,y,n;
            clrscr();
            row=1;
            printf("\n Enter any no for multiplication no:->");
            scanf("%d",&n);
            printf("Multiplication Table\n");
            printf("--------------------------------\n");
            do
            {
            column =1;
            do
            {
            y=row*column;
            printf("%4d",y);
            column=column+1;
            }
            while(column<=n);
            printf("\n");
            row=row+1;
            }
            while(row<=n);
            getch();
}
------------------------------------------------------------------------------------------------------------------------------

Prog42 : prog for swith….case statement,

#include<stdio.h>
#include<conio.h>
void main()

            {
            int i=2;
            clrscr();
            switch (i)
            {
                        case 1:
                                    printf("this is one \n");
                                    break;
                        case 2:
                                    printf("this is two \n");
                        case 3:
                                    printf("this is three \n");
                                    break;
                        default:
                                    printf("this is default \n");
            }
            getch();
            }
------------------------------------------------------------------------------------------------------------------------------





Prog43 : prog for numbers

#include<stdio.h>
#include<conio.h>
            void main()
{
            int n1,n2;
            int res;
            char op;
            clrscr();
            printf("Enter the two number :\n");
            scanf("%d %d",&n1,&n2);
            printf(" Enter the operatpor : ");
            fflush(stdin);
            scanf("%c",&op);
            printf ("%d",calc (n1,n2,op) );
            getch();
     }
            int calc (int i, int j, char ch)
            {
               switch(ch)
               {
                  case '+'  : return(i+j);
                  case '-'  : return(i-j);
                  case '*'  : return(i*j);
                  case '/'  : return(i/j);
                }
              return (0);
            }
------------------------------------------------------------------------------------------------------------------------------

prog 44 : perform add mul sub div using switch   

#include<stdio.h>
#include<conio.h>
void main()
{
            int a,b,res;
            char ch;
            clrscr();
            printf("Enter value of a :->");
            scanf("%d",&a);
            printf("Enter value of b :->");
            scanf("%d",&b);
            printf("Enter Operation choice ");
            scanf(" %c",&ch);
            switch(ch)
       {
            case '+':
            printf("\nAddition is %d", a+b);
            break;
            case '-':
                        printf("\nSub is %d", a-b);
                        break;
            case '*':
                        printf("\nMul is %d", a*b);
                        break;
            case '/':
                        printf("\nDiv is %d", a/b);
                        break;
            default:
                        printf("\nSorry ... Pls.. Enter proper choice");
      }
            getch();

}
------------------------------------------------------------------------------------------------------------------------------
prog 45 :prog for finding a no whether it is prime or not

#include<stdio.h>
#include<conio.h>
void main()
            {
            int i=2;
            int num;
            clrscr();
            printf("enter no :-");
            scanf ("%d", &num);
            while (i<=num-1)
            {
            if (num%i==0)
            {                      printf ("not a prime number");
                                    getch();
                                    break;
            }
                        i++;
             }
            if (i==num)
            {
                        printf ("is a prime number");
                        getch();
            }
            }

output
enter no :-17
is a prime number
------------------------------------------------------------------------------------------------------------------------------
prog46 : Prog for numbers

#include<stdio.h>
#include<conio.h>
void main()
{
            int no=1;
            int ans;
            clrscr();
            while (no<=100)
{
            if (no%2==0)
            printf ("\t%d", no);
            no++;
}
            getch();
}
------------------------------------------------------------------------------------------------------------------------------








Prog47 : prog to display 1..3..5 up to 99.

# include <stdio.h>
# include <conio.h>
void main()
{
            int i=1,j=0;
            clrscr();
            while(j<50)
            {
            if(i%2!=0)
            {
            printf("\t %d",i);
            j++;
            }
            i++;
            }
            printf("\n %d",j);
            getch();
}
                                   OUTPUT
                           1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49
                           51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95
                           97 99
------------------------------------------------------------------------------------------------------------------------------

`           Prog48 : This programme is to print the series 1,3,5,7,9..... upto 99.

# include "stdio.h"
# include "conio.h"
voidmain()
{
             int i;
             clrscr();
             i=1;
             while(i<=99)
             {
                        printf("\t %d",i);
                        i=i+2;
             }
             getch();
             return 0;
}
------------------------------------------------------------------------------------------------------------------------------

Prog49 : // This programme is to get the number in reverse manner.
# include <stdio.h>
# include <conio.h>
main()
{
             int i,j=0;
             clrscr();
             printf("Enter the number : ");
             scanf("%d",&i);
             while(i!=0)
            {
             j=j*10+(i%10);
             i=i/10;
            }
             printf("%d",j);
             getch();
             return 0;
}
------------------------------------------------------------------------------------------------------------------------------

Prog50 : This programme is to print the series 1,2,4,7,11..... upto 10 steps

# include <stdio.h>
# include <conio.h>
void main()
{
   int i,v,incr;
   clrscr();
   i=1;
   v=1;
   incr=1;
   while(i<=10)
   {
              printf("\t %d",v);
              i++;
              v=v+incr;
             incr=incr+1;
             }
             getch();
             return 0;
             }
------------------------------------------------------------------------------------------------------------------------------
Prog51 :  This programme is to print  1 t0 10 in increment order using  Do-while statement.

# include <stdio.h>
# include <conio.h>
void main()
{
   int i;
   clrscr();
   i=1;
   do
   {
             printf("\n %d",i);
             i++;
   }
   while(i<=10);
   getch();
   return 0;  
}
------------------------------------------------------------------------------------------------------------------------------
prog52 :  print the reverse no

# include <stdio.h>
# include <conio.h>
void main()
{
            int no,tmpno=1;
            unsigned rev=0;
            clrscr();
            printf("\nEnter number to reverse it:->");
            scanf("%d",&no);
            tmpno=no;
            while(no>0)
            {
            rev= rev*10 + no%10;
            no /= 10;
            }
            printf("\n The reverse no is :->%u",rev);
            getch();
}
------------------------------------------------------------------------------------------------------------------------------
Prog53  print the multiplication table

#include<stdio.h>
#include<conio.h>
void main()
{
            int row,column,y,n;
            clrscr();
            row=1;
            printf("\n Enter any no for multiplication no:->");
            scanf("%d",&n);
            printf("Multiplication Table\n");
            printf("--------------------------------\n");
            do
            {
            column =1;
            do
            {
                        y=row*column;
                        printf("%4d",y);
                        column=column+1;
                        }
                        while(column<=n);
                        printf("\n");
                        row=row+1;
            }
            while(row<=n);
            getch();
}







Prog 54 : prog for counting avg of 10 marks

#include<stdio.h>
#include<conio.h>
void main()
{
            int marks[10];
            int i,sum=0;
            float avg;
            clrscr();
 for (i=0;i<10;i++)
            {
            printf ("\nEnter marks %d: ",i+1);
            scanf ("%d", &marks[i]);
            }
  for (i=0;i<10;i++)
             sum=sum+marks[i];
  avg=sum/10.0;

            printf("\n\n\n");
            printf("avg is %f",avg);
            getch();
}

output:
Enter marks 1: 12
Enter marks 2: 13
Enter marks 3: 14
Enter marks 4: 15
Enter marks 5: 16
Enter marks 6: 17
Enter marks 7: 18
Enter marks 8: 19
Enter marks 9: 11
Enter marks 10: 10
avg is 14.500000





prog55 : prog for displaying 10……1 .                  
# include <stdio.h>
# include <conio.h>
void main()
{
            int a[10],i,temp,j;
            clrscr();
            for(i=0;i<=9;i++)
            {
            printf("\n enter value one by one :");
            scanf("%d",&a[i]);
            }
            for(i=0;i<=9;i++)
            {
            for(j=0;j<=i;j++)
            {
            if(a[i]>a[j])
            {
            temp=a[i];
            a[i]=a[j];
            a[j]=temp;
            }
            }
            }
            for(i=0;i<=9;i++)
            {
            printf("\n %d",a[i]);
            }
            getch();
}
                           OUTPUT
                           10
                           9
                           8
                           7
                           6
                           5
                           4
                           3
                           2
                           1
Prog56 : // program for addition of two matrix

#include<stdio.h>
#include<conio.h>
void main()
{
            int a[3][3],b[3][3],c[3][3];
            int i,j,l,m;
            clrscr();
            printf("Enter the elements in the first matrix\n");
            for(i=0;i<3;i++)
            {
                        for(j=0;j<3;j++)
                        {
                                    scanf("%d",&a[i][j]);
                        }
            }
            printf("Enter the elements in the second matrix\n");
            for(l=0;l<3;l++)
            {
                        for(m=0;m<3;m++)
                        {
                                    scanf("%d",&b[l][m]);
                        }
            }

            printf("You have the following numbers into first matrix\n");
            for(i=0;i<3;i++)
            {
                        for(j=0;j<3;j++)
                        {
                                    printf("%d",a[i][j]);
                        }
                        printf("\n");
            }
            printf("\nThe Addition of the two matrix are\n");
            for(i=0;i<3;i++)
            {
               for(j=0;j<3;j++)
               {
                        c[i][j]=a[i][j]+b[i][j];
               }
            }
            for(i=0;i<3;i++)
            {
                        for(j=0;j<3;j++)
                        {
                                    printf("%d   ",c[i][j]);
                        }
                        printf("\n");
            }
getch();
}
------------------------------------------------------------------------------------------------------------------------------

Prog57 : prog for two dimention array
           
#include<stdio.h>
#include<conio.h>
void main()
{
   int arr[3] [4];
   int i,j;
   clrscr();
   for (i=0; i<3; i++)
            {
             for(j=0; j<4; j++)
               {
             printf ("\n Enter a no at[%d] [%d]  :", i,j);
             scanf ("%d", &arr [i][j]);
               }
             }
             for (i=0; i<3; i++)
               {
             printf ("\n The no at[%d][%d] is  :%d", i,j,arr[i][j]);

               }
            }





output

            Enter a no at[0] [0]  :12

            Enter a no at[0] [1]  :12

            Enter a no at[0] [2]  :13

            Enter a no at[0] [3]  :14

             Enter a no at[1] [0]  :14

              Enter a no at[1] [1]  :15

               Enter a no at[1] [2]  :14

            Enter a no at[1] [3]  :13

             Enter a no at[2] [0]  :16

              Enter a no at[2] [1]  :17

               Enter a no at[2] [2]  :18

            Enter a no at[2] [3]
  : 12
------------------------------------------------------------------------------------------------------------------------------

Prog58 : DEFINATION:-TO PRINT ARRAY IN THE ASENDING ORDER

#include<stdio.h>
#include<conio.h>
void main()
{
int arr[5];
int i,j,temp;
clrscr();
for(i=0;i<5;i++)           {
             printf("Enter the element [%d]:",i);
             scanf("%d",&arr[i]);
             }
for(i=0;i<5;i++)
{
            for(j=i+1;j<5;j++)
                        {
                        if(arr[j]<arr[i])
                                    {
                                                temp=arr[i];
                                                arr[i]=arr[j];
                                                arr[j]=temp;
                                     }
                         }
}
for(i=0;i<5;i++)
{
//printf("the ascending element [%d]:",i);
printf("\n\t %d",arr[i]);
}
getch();
}

OUTPUT
Enter the element [0]:5
Enter the element [1]:4
Enter the element [2]:2
Enter the element [3]:0
Enter the element [4]:1

                                    0
                                    1
                                    2
                                    4
                                    5








PROG 59 :TO PRINT THE AVERAGE OF THE ARRAY ELEMENT

#include<stdio.h>
#include<conio.h>
void main()
{
int stu[5];
int i,n,sum=0;
float Avg;
clrscr();
printf("How many marks are entered");
scanf("%d",&n);
            for(i=0;i<5;i++)
            {
            printf("\n Enter the value of student[i]");
            scanf("%d",&stu[i]);
            }
            for(i=0;i<5;i++)
            sum+=stu[i];

            printf("%f",sum/5.0);
            getch();
}

OUTPUT

Enter the value of student[i]5

Enter the value of student[i]6

Enter the value of student[i]7

Enter the value of student[i]8

Enter the value of student[i]9

7.000000




Prog60 : To find the maximum and minimum number using array.

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int num[5];
int i,max,min;
clrscr();
for(i=0;i<5;i++)
            {
            printf("Enter the value at [%d]:",i);
            scanf("%d",&num[i]);
            }
            max=num[0];
for(i=0;i<5;i++)
            {
            if(num[i]>max)
            max=num[i];
            }
            min=num[0];
for(i=0;i<5;i++)
            {
            if(num[i]<min)
            min=num[i];
            }
            printf("\n max value is %d",max);
            printf("\n\n min value is %d",min);
            getch();
}

OUTPUT
Enter the value at [0]:5
Enter the value at [1]:4
Enter the value at [2]:3
Enter the value at [3]:90
Enter the value at [4]:88
            max value is 90
 min value is 3

PROG61 : TO SERACH A CHARECTER IN THE ARRAY.

#include<stdio.h>
#include<conio.h>
#include<stdio.h>
void main()
{
char str[15];
char n;
int i=0,c=0;
clrscr();
              printf("\n\tEnter the string:  ");
              gets(str);
              printf("\n\tEnter search character:  ");
              scanf("%c",&n);
while(str[i])
{
if(str[i]==n)
            c++;
            i++;
}
printf("\n\tIn the string %d times are character are search ",c);
getch();
}

          OUTPUT
            Enter the string:  VIBHAKAR
            Enter search character:  A
            In the string 2 times are character are search
           
------------------------------------------------------------------------------------------------------------------------------

PROG 62 :Prog for binary search

# include <stdio.h>
# include <conio.h>
int SIZE=10;
void main()
{
            int i,j,m,tmp,n,s,a[10],f,l,yn=0;
            clrscr();
            fflush(stdin);
            for (i=0; i<SIZE; i++)
            {                     
printf ("Enter a[%d] element :",i);
            scanf("%d",&a[i]);
            }
            for (i=0; i<SIZE; i++)
            {
            for (j=i+1; j<SIZE; j++)
            {
            if (a[i]>a[j])
            {
            tmp=a[i];
            a[i]=a[j];
            a[j]=tmp;
            }
            }
            }
            printf ("Enter Element to be Found : ");
            scanf ("%d",&s);
            f=0;
            l=SIZE-1;
            while (f<=l)
            {
            m=(f+l)/2;
            if (s>a[m])
            f=m+1;
            else
            {
            if (s<a[m])
            l=m-1;
            else
            if(s==a[m])
            {
            yn=1;
            break;
            }
            }
            }
            if (yn==1)
            printf ("\n %d element is Found ",s);
            else
            printf ("\n %d element is NOT found",s);
            getch();
}

 OUTPUT
            Enter a[0] element :1
            Enter a[1] element :2
            Enter a[2] element :3
            Enter a[3] element :6
            Enter a[4] element :4
            Enter a[5] element :5
            Enter a[6] element :9
            Enter a[7] element :5
            Enter a[8] element :2
            Enter a[9] element :3
            Enter Element to be Found : 3
            3 element is Found
------------------------------------------------------------------------------------------------------------------------------
Prog 63 :prog for two dimention array

#include<stdio.h>
#include<conio.h>
void main()
{
             int i,j,temp,*ptr,*ptr1;
            clrscr();
             ptr = &i;
             ptr1 = &j;
            printf ("\n Enter number-1  :");
              scanf ("%d", &i);
             printf ("\n Enter number-2  :");
             scanf ("%d", &j);
              temp = *ptr;
            *ptr = *ptr1;
             *ptr1= temp;
             printf ("\n Number after swapping ");
             printf ("\n The first no is :%d", *ptr);
            printf ("\n The second no is :%d", *ptr1);      
            getch();
}

output
 Enter number-1  :13
 Enter number-2  :45
 Number after swapping
 The first no is :45
 The second no is :13
------------------------------------------------------------------------------------------------------------------------------

Prog 64 : prog for two dimention array

            #include<stdio.h>
#include<conio.h>
void main()
{
   int i,j,temp,*ptr,*ptr1;
   clrscr();
   ptr = &i;
   ptr1 = &j;
   printf ("\n Enter number-1  :");
   scanf ("%d", &i);
   printf ("\n Enter number-2  :");
   scanf ("%d", &j);
   temp = *ptr;
   *ptr = *ptr1;
   *ptr1= temp;
   printf ("\n Number after swapping ");
            printf ("\n The first no is :%d", *ptr);
            printf ("\n The second no is :%d", *ptr1);
             getch();
}

output
            Enter number-1  :13
            Enter number-2  :45
            Number after swapping
            The first no is :45
            The second no is :13



Prog 65 : prog for swaping using pointer

#include<stdio.h>
#include<conio.h>
#include<string.h>
            void main()
{
   char i,j,temp,*ptr,*ptr1;
   clrscr();
   ptr  =&i;
   ptr1 =&j;
   printf ("\n Enter string1  :");
            scanf ("%c",&i);
   fflush (stdin);
   printf ("\n Enter string2  :");
   scanf ("%c",&j);
   temp =*ptr;
  *ptr =*ptr1;
   *ptr1=temp;
   printf ("\n String after swapping ");
   printf ("\n The first string is :%c", *ptr);
            printf ("\n The second string is :%c",*ptr1);
            getch();
}

output
    Enter string1  :qwe
    Enter string2  :wer
    String after swapping
    The first string is :w
     The second string is :q











Prog 66 :prog for counting spaces,lines blanks,tabs
           
#include<stdio.h>
#include<conio.h>
void main()
{
            FILE *fp;
            char ch;
            int nol=0,not=0,nob=0,noc=0;
            fp=fopen("z:\search.c","r");
            clrscr();
               while(1)
               {
                  ch=fgetc(fp);

                  if (ch==EOF)
                  break;
                  noc++;
                  if (ch==' ')
                  nob++;
                  if (ch=='\n')
                  nol++;
                  if(ch=='\t')
                  not++;
               }
               fclose(fp);
               printf("\n Number of char = %d",noc);
               printf("\n Number of blanks = %d",nob);
               printf("\n Number of tabs = %d",not);
               printf("\n Number of lines = %d", nol);
               getch();
               return (1);
            }

------------------------------------------------------------------------------------------------------------------------------






Prog67 : prog for file handling

#include <stdio.h>
#include <conio.h>
void main()
{
  FILE *fp,*fc;
  char ch;
  clrscr();
  fp=fopen("z:\\abcd.txt","r");
  fc=fopen("z:\\ab.txt","w");
  if (fp==NULL)                     {
            puts ("can not find a file please try again");
            }
            else
            {
            while((ch=fgetc(fp))!=EOF)
            {
            fputc(fp);
            printf("%c",ch);
            }
            fclose(fp);
            fclose(fc);
            }
            getch();
            }
------------------------------------------------------------------------------------------------------------------------------

Prog 68 : Binary Tree Creation and Traversals  
           
#include <stdio.h>
#include <conio.h>
struct bTreeNode
{
 int data;
 struct bTreeNode *lChild;
 struct bTreeNode *rChild;
};


void main()
{
  struct bTreeNode *bt;
  int tot,no,i=1;
  clrscr();
  bt=NULL;
  printf("\n Specify no of items : ");
  scanf("%d",&tot);
             while(i<=tot)
  {
   printf("\n Enter Data:");
   scanf("%d",&no);
   insert(&bt,no);
   i++;
  }
  printf("\n Traversing tree in inOrder Traversal  :\n");
  inOrder(bt);
  printf("\n Traversing tree in preOrder Traversal  :\n");
  preOrder(bt);
  printf("\n Traversing tree in postOrder Traversal  :\n");
  postOrder(bt);
  getch();
}
Insert(struct bTreeNode **bRoot,int n){
 if (*bRoot == NULL)
 {
    *bRoot = malloc(sizeof(struct bTreeNode));
    (*bRoot)->lChild = NULL;
    (*bRoot)->data = n;
    (*bRoot)->rChild = NULL;
    return;
 }
 else
 {
            if (n < (*bRoot)->data)
             insert ( &((*bRoot)->lChild),n);
            else
            insert(&((*bRoot)->rChild),n);
 }
            return;
}
inOrder(struct bTreeNode *bRoot)
{
  if (bRoot!=NULL)
  {
     inOrder(bRoot->lChild);   
     printf("%4d",bRoot->data);
     inOrder(bRoot->rChild);
  }
  else   
    return;
}
preOrder(struct bTreeNode *bRoot)
{
  if (bRoot!=NULL)
  {
     printf("%4d",bRoot->data);
     preOrder(bRoot->lChild);
     preOrder(bRoot->rChild);
  }
  else
    return;
}

postOrder(struct bTreeNode *bRoot)
{
             if (bRoot!=NULL)
  {
             postOrder(bRoot->lChild);
             postOrder(bRoot->rChild);
            printf("%4d",bRoot->data);
             }
            else
             return;
}


------------------------------------------------------------------------------------------------------------------------------




prog 69 structure

#include<stdio.h>
#include<conio.h>
#nclude<stdlib.h>
struct raj
            {
   int code;
   char nm[30];
   struct raj *r;
 };
  typedef struct raj node;
            nt menu();
            oid add();
            oid del();
            oid view();
            ode *fst=NULL,*lst=NULL;

             void main()
           
            nt opt=1;
             clrscr();
            hile(opt!=0)
            {
            pt=menu();
            witch(opt)
           
             case 1: add();
            reak;
            ase 2: del();
            reak;
            ase 3: view();
           
             }
           
             int menu()
            {
            int choice;
            lrscr();
            printf("\n0...exit");
            printf("\n1....add");
            printf("\n2....del");
             printf("\n3....vie");
            rintf("\nwhat is your choice: ");
            scanf("%d",&choice);
             return(choice);
              }
             void add()
             {
            if(fst==NULL)           {
               fst=lst=(node*)malloc(sizeof(node));
               printf("\nenter the node:-  ");
               scanf("%d",&fst-> code);
               printf("enter name:-  ");
               fflush(stdin);
               gets(fst->nm);
               fst->r=NULL;
             }
             else
             {
              lst->r=(node*)malloc(sizeof(node));
              lst=lst->r;
              lst->r=NULL;

              printf("\nenter the code:-  ");
              scanf("%d",&lst->code);
              printf("\nenter the name :-  ");
              fflush(stdin);
              gets(lst->nm);
             }
             }
            void del()
                {
             node *dst;
             dst=fst;
              if(fst==NULL)
               {
                 printf("\nempty queue");
                 getch();
                 return;
               }
               fst=fst->r;
               printf("\ndeleted code is = %d",dst->code);
               free(dst);
               getch();
            }

             void view()
             {
                node *vpt;
                vpt=fst;
                if(vpt==NULL)
                {
                  printf("\n queue is not created ");
                  getch();
                  return;
                }
                 while(vpt!=NULL)
                {
                  printf("\ncode:- %d",vpt->code);
                  printf("\tname:- %s",vpt->nm);
                  vpt=vpt->r;
                }
                getch();
             }




prog 70 :"program of stack operation"

#include <stdio.h>
#include <conio.h>
struct stack
{
            int data;
            struct stack *prev;
};
struct stack *node;
void main()
{
            int ch,n;
            char c;
            clrscr();
            node=NULL;
            printf("\n 1. Push ");
            printf("\n 2. Pop ");
            printf("\n 3. Display");
            printf("\n 4. Exit");
            printf("\n Enter your choice (1-4): ");
            scanf("%d",&ch);
            while(ch>=1&&ch<=4)
            {
                        switch(ch)
                        {
                                    case 1:

                                                push(node);
                                                break;

                                    case 2:
                                                pop(node);
                                                break;

                                    case 3:
                                                disp(node);
                                                break;
                                    case 4:
                                                exit(0);
                        }
                        getch();
                        clrscr();
                        printf("\n 1. Push ");
                        printf("\n 2. Pop ");
                        printf("\n 3. Display");
                        printf("\n 4. Exit");
                        printf("\n Enter your choice (1-4): ");
                        scanf("%d",&ch);
            }
            getch();
}
push(struct stack *rec)
{
            struct stack *new1;
            new1=(struct stack *)malloc(sizeof(struct stack));
            printf("\nEnter element to push: ");
            scanf("%d",&new1->data);
            new1->prev=rec;
            node=new1;
            return (0);
}
pop(struct stack *rec)
{
            node=rec->prev;
            free(rec);
            return (0);
}
disp(struct stack *rec)
{
            while(rec)
            {
                        printf("\n%d",rec->data);
                        rec=rec->prev;
            }
                        return (0);
}

Twitter Delicious Facebook Digg Stumbleupon Favorites More