How to print a number series with color output ?


      Program:-
#include<conio.h>
#include<graphics.h>
#include<stdio.h>
void main()
{
clrscr();
for(int i=1;i<=7;i++)
{
for(int j=1;j<=i;j++)
{
textcolor(i);
cprintf("%d",i);
}
printf("\n");
}
getch();
}

How to print a Number Series with color output ?


  Program:---
#include<stdio.h>
#include<graphics.h>
#include<conio.h>
void main()
{
clrscr();
for(int i=1;i<=10;i++)
{
for(int j=1;j<=i;j++)
{
textcolor(i);
cprintf("%d",j);
}
printf("\n");
}
getch();
}

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();
}

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

GET UP TO 70% OFF