Print Figures

C/C++ Program to Print Following Pattern

Here I am sharing the C and C++ program to print the pattern shown in below image. This pattern is printed using stars (*). It has two parts, the lower half is just opposite of upper half. Comment below if you are facing any problem in understanding the code. C Program C++ Program

C++ Program to Print Heart Shape With Happy Friendship Day Message Inside it

On this special day I thought to share something unique. So here is the program to print heart shape with happy friendship day message inside it. You can give this as a gift to your programmer friend. If you like it, don’t forget to share it! Also Read: C Program to Print India Map #include <iostream> …

C++ Program to Print Heart Shape With Happy Friendship Day Message Inside it Read More »

C Program to Print India Map

In this article, I am sharing the program to print the India map. If you like it, please do share it! Output: For an explanation of the code visit http://stackoverflow.com/questions/3533348/how-does-this-code-generate-the-map-of-india

C program to print following triangle:

#include<stdio.h> #include<conio.h> void main() { int i,j,k,n,a,b; clrscr(); printf(“How many lines?”); scanf(“%d”,&n); n=n*2; for(i=1;i<n;i+=2) { for(j=n-1;j>i;j-=2) printf(” “); for(k=1;k<=(i/2)+1;++k) printf(“%d”,k); for(k=i/2;k>=1;–k) printf(“%d”,k); printf(“n”); } getch(); }

C++ program to print the following design:

#include<iostream.h>#include<conio.h>void main(){ clrscr(); //to clear the screen int i,j,k,n;  cout<<“How many lines?”; cin>>n;  n*=2; for(i=0;i<n;i+=2) { cout<<“n”; for(j=1;j<i;j+=2) cout<<” “; for(k=n-1;k>i;–k) cout<<“*”; } getch(); //to stop the screen}