Skip to main content

Posts

Showing posts with the label Code

CONSTRUCTOR DYNAMIC INITIALIZATION

CONSTRUCTOR OVERLOADING

Constructor Overloading ********************************************************************************

TO FIND ARITHMETIC MEAN BY STEP DEVIATION METHOD

TO FIND ARITHMETIC MEAN BY STEP DEVIATION METHOD

FUNCTION OVERLOADING

Function Overloading #include<iostream> #include<conio.h> using namespace std; void area(int,int,int); void area(int,int); void area(int); int main() { int side=9; area(side); int len=7,bre=8; area(len,bre); int a=3,b=2,c=9; area(a,b,c); cout<<"\n END" ; getch(); return 0; }

QUEUE

QUEUE   //QUEUE #include<stdio.h> #include<conio.h> #include<alloc.h> typedef struct stk { int info; struct stk *link; }node; node *start; void create() { printf("\n'Create' Function Called\n"); start=NULL; } void enqueue() {

INSERTION SORT

Insertion Sort #include<iostream> #include<conio.h> using namespace std; int main() { int a[]={1,2,6,8,9,4,5,7,0,3,2}; int temp; for(int i=0;i<11;i++) { for( int j=0;j<11;j++ ) { if( a[j+1]<a[j] ) { temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; }

BUBBLESORT

Q1 :  Write a C program for BubbleSort ? #include<conio.h>                                         #include<stdio.h>                                          void main()                                                     {                                                                      int i,j,n,tmp,a[20];                                          ...

MATRIX

Q1 :  Write a C program to print a " Matrix" as an output by using arrays? #include<conio.h>                                                   #include<stdio.h>                                                    void main()                                                               {                                                                               int a...

FIBONACCI SEQUENCE

Q1 :  Write a C program to print " Fibonacci Sequence " as an output? #include<conio.h>     #include<stdio.h>      void main()                 {                                  //fibonacci series        int a=0,b=1,i,c=0;       clrscr();                       for(i=1;i<=10;i++)       {                                 printf("%d\t",c);          a=b;                           b=c;                           c=a+b;                 ...

SWAPPING OF VALUES C CODE

Q1 : Write a C program to " interchange" values without using third                     variable?  #include<conio.h>                       #include<stdio.h>                        void main()                                  {                                                   clrscr();                                        //interchange number                  int a=4;                   ...

BIGGER NUMBER

 Q1 :  Write a C program to print "Bigger number"  out of the three?   Using nested if:  #include<conio.h>                       #include<stdio.h>                        void main()                                   {                                                   //bigger number                           int a=20,b=405,c=78;                  clrscr();                                       ...

FACTORIAL C CODE

  Q1 :  Write a C program to print Factorial of a number as an output?   Using Goto:  #include<conio.h>                                  #include<stdio.h>                                   void main()                                             {                                                             int n;                                                       ...

HELLO WORLD

Q1 :  Write a C program to print "hello world" as an output? #include<conio.h>   #include<stdio.h>    void main()              {                               clrscr();                    printf("hello world"); getch();                    }                               *********************************************************************************** Sample Output: