Neeraj Mishra

A crazy computer and programming lover. He spend most of his time in programming, blogging and helping other programming geeks.

C program to produce the folowing design using *'s

#include<stdio.h> #include<conio.h> void main() { int i,j,n; char ch=’A’; clrscr(); //to clear the screen printf(“How many lines?”); scanf(“%d”,&n); for(i=0;i<n;++i) { for(j=0;j<=i;++j) printf(“%c”,ch+j); printf(“n”); } getch();     //to stop the screen }

C++ program to calculate area of a circle,a rectangle or a triangle depending upon user's choice

#include<iostream.h>#include<conio.h>#include<math.h> void main(){ clrscr(); //to clear the screen float a,b,c,s,r,area; int ch; cout<<“***Menu***n1.Area of circlen2.Area of Rectangle”; cout<<“n3.Area of trianglenEnter your choice:”; cin>>ch; switch(ch) { case 1: { cout<<“nEnter radius of the circle:”; cin>>r; area=3.14*r*r; break; } case 2: { cout<<“nEnter length and breadth:”; cin>>a>>b; area=a*b; break; } case 3: { cout<<“nEnter three sides of …

C++ program to calculate area of a circle,a rectangle or a triangle depending upon user's choice Read More »

C program to find average of list of numbers entered through keyboard

#include<stdio.h> #include<conio.h> void main() { int i,n,sum=0,e; float avg; clrscr(); //to clear the screen   printf(“How many elements:”); scanf(“%d”,&n); printf(“Enter all the elements one by one:”); for(i=0;i<n;++i) { scanf(“%d”,&e); sum+=e; } avg=sum/n; printf(“nAverage=%f”,avg); getch(); //to stop the screen }

C Program for Leap Year

Before knowing the C program for leap year lets first understand what exactly is a leap year. What is a Leap Year? In a normal year there are 365 days while in a leap year there are 366 days. Here the extra day is the 29th feb. How to Check Year is a Leap Year …

C Program for Leap Year Read More »

C Program to Print Multiplication Table of Given Number

Here you will get C program to print multiplication table of given number. Below program will ask user to enter a number then display its table. #include<stdio.h> int main() { int i,n; printf(“Enter any number:”); scanf(“%d”,&n); printf(“Table of %d is:\n”, n); for(i=1;i<=10;++i) printf(“\n%d*%d=%d”,n,i,n*i); return 0; }   Output Enter any number:6 Table of 6 is: …

C Program to Print Multiplication Table of Given Number Read More »