Write a program to print a Table ?



Program:-

#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int a=2;
clrscr();
textcolor(YELLOW);
cprintf("Table of 2 -:\n");
for(int b=1;b<=10;b++)
{
int c=a*b;
textcolor(c+1);
printf("\n");
cprintf("%d",c);
}
getch();

}

Multiple Inheritance Program

Output


Program:

#include<iostream.h>
#include<conio.h>
class sample
{
private:
int a,b;
public:
void getdata(int x,int y)
{
a=x;
b=y;
}
void display()
{
int sum=a+b;
cout<<"**** Multiple Inheritance Example ****"<<endl<<endl;
cout<<"The sum is ="<<sum<<endl;
}
};
class test
{
public:
void show()
{
cout<<"This is the second class"<<endl;
}
};
class final:public sample,public test
{
public:
void showdata()
{
cout<<"This is the Multiple Inheritance Class"<<endl;
}
};
void main()
{
clrscr();
final f;
f.getdata(10,10);
f.display();
f.show();
f.showdata();
getch();
}

Multilevel Inheritance Program in C++

OUTPUT OF MULTILEVEL INHERITANCE

Program:--

#include<iostream.h>
#include<conio.h>
class student
{
public:
void display()
{
 cout<<"This is the 1st Class"<<endl;
}
};
 class result:public student
{
public:
 void display1()
{
cout<<"This is the 2nd Class"<<endl;
}

} ;
 class marks :public result
{
  public:
  void getdata()
{
cout<<"This is the 3rd Class";
}
};
void main()
{
    clrscr();
    marks s;
    s.display();
    s.display1();
    s.getdata();
     getch();
}

Print Identity Card with colorful Output


















Program---:
#include<conio.h>
#include<graphics.h>
#include<stdio.h>
void main()
{
clrscr();
textcolor(CYAN);
cprintf("*** IDENTY CARD ***");
printf("\n");
textcolor(RED);
cprintf("Name:____________");
printf("\n");
cprintf("Roll No.__________");
printf("\n");
cprintf("Class_____________");
printf("\n");
cprintf("Mob_No.___________" );
printf("\n");
cprintf("Add:_______________");
getch();
}

C Program To Print Pattern

#include<graphics.h>
#include <stdio.h>
#include <conio.h>
void main() {
int h,m,t,temp=1;
clrscr();
for (h=1; h<=5; h++) {
for (t=temp; t<=5; t++) {
                    textcolor(b+1);
cprintf(" ");
}
for (m=0; m< a; m++) {
printf("*");
}
temp = temp + 1;
printf("\n");
}
temp = 1;
for (h=4; h>=1; h--) {
for (t=temp; t>=0; t--) {
printf(" ");
}
for (m=a; m>=1; m--) {
                        textcolor(b=1)
cprintf("*");
}
temp= temp + 1;
printf("\n");
}
getch();
}
                                                                     output

Print Heart With Star

#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int i,j,n;
clrscr();
textcolor(RED);
cprintf("Enter the value of n:");
scanf("%d",&n);
for(i=n/2;i<=n;i+=2)
{
for(j=1;j<=n-i;j+=2)
{
printf(" ");
}
for (j=1;j<=i;j++)
{
textcolor(j);
cprintf("*");
}
for(j=1;j<=n-i;j++)
{
printf(" " );
}
   for(j=1;j<=i;j++ )
   {
   textcolor(j);
   cprintf("*");
   }
   printf("\n");
}
for(i=n;i>=1;i--)
{
for(j=i;j<n;j++)
{
printf(" ");
}
for(j=1;j<=(i*2)-1;j++)
{
textcolor(j);
cprintf("*");
}
printf("\n");
}

getch();
}
                                                                   Output

Program:- #include<stdio.h> #include<conio.h> #include<graphics.h> void main() { int a=2; clrscr(); ...

GET UP TO 70% OFF