Programs, Uncategorized

C Program to draw star pattern

#include<stdio.h> int main() { int i, j; for(i=1; i<=5; i++) { for(j=5; j>i; j--) { printf(" "); } printf("*"); for(j=1; j<(i-1)*2; j++) { printf(" "); } if(i==1) printf("\n"); else printf("*\n"); } for(i=4; i>=1; i--) { for(j=5; j>i; j--) { printf(" "); } printf("*"); for(j=1; j<(i-1)*2; j++) { printf(" "); } if(i==1) printf("\n"); else printf("*\n"); }… Continue reading C Program to draw star pattern

Programs, Uncategorized

Inheritance in C++ | program to build master table of data

#include<iostream> #include<cstring> using namespace std; class base1 { char dob[10],bg[3]; public: char name[20]; void get1(); void disp1(); }; class base2 { float ht,wt; public: void get2(); void disp2(); }; class base3 { int policyno; char address[20]; public: void get3(); void disp3(); }; class derived:public base1,public base2,public base3 { int tno,dln; public: int present; derived() {… Continue reading Inheritance in C++ | program to build master table of data