Twitter Feed Facebook Google Plus Youtube

Adsense responsive

Recent Post below header

Saturday 2 February 2013

C PROGRAM: TO CALCULATE ARITHMETIC MEAN OF THREE NUMBERS

CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
int num1,num2,num3;
float am;
clrscr();
printf("Enter 1st no. ");
scanf("%d",&num1);
printf("Enter 2nd no. ");
scanf("%d",&num2);
printf("Enter 3rd no. ");
scanf("%d",&num3);
am=(num1+num2+num3)/3.0;
printf("Arithmetic mean: %f",am);
getch();
}


CODING

OUTPUT

For any query or suggestion please comment below...

C PROGRAM: TO REVERSE ANY STRING

CODING:
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char a[50];
clrscr();
printf("Enter any string: ");
gets(a);
printf("\n\nReversed string: %s",strrev(a));
getch();
}


CODING

OUTPUT

For any query or suggestion please comment below...


C PROGRAM: TO MULTIPLY TWO NUMBERS

CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
int num1,num2,prod;
clrscr();
printf("Enter first number ");
scanf("%d",&num1);
printf("Enter second number ");
scanf("%d",&num2);
prod=num1*num2;
printf("\nProduct of %d and %d is %d",num1,num2,prod);
getch();
}


CODING

OUTPUT

For any query or suggestion please comment below...

C PROGRAM: TO CHECK WHETHER A NUMBER IS PRIME OR NOT

CODING:
#include<conio.h>
#include<stdio.h>
void main()
{
int num,rm,i;
clrscr();
printf("Enter any number: ");
scanf("%d",&num);
for(i=2;i<=num-1;i++)
{
rm=num%i;
if(rm==0)
break;
}
if(rm==0)
printf("\n%d is not a prime number",num);
else
printf("\n%d is a prime number",num);
getch();
}


CODING

OUTPUT

For any query or suggestion please comment below...

C PROGRAM: TO CHECK WHETHER A GIVEN NUMBER IS EVEN OR ODD

CODING:
#include<conio.h>
#include<stdio.h>
void main()
{
int num,rm;
clrscr();
printf("Enter any number: ");
scanf("%d",&num);
rm=num%2;
if(rm==0)
printf("\nNumber is even");
else
printf("\nNumber is odd");
getch();
}


CODING

OUTPUT

For any query or suggestion please comment below...

Friday 1 February 2013

C PROGRAM: TO CALCULATE AREA OF TRIANGLE

CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
float base,height,area;
clrscr();
printf("Enter base of triangle ");
scanf("%f",&base);
printf("Enter height of triangle ");
scanf("%f",&height);
area=0.5*base*height;
printf("Area of triangle = %f",area);
getch();
}


CODING

OUTPUT

For any query or suggestion please comment below..

C PROGRAM: TO CALCULATE AREA OF CIRCLE

CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
float r,ar;
clrscr();
printf("Enter radius ");
scanf("%f",&r);
ar=3.14*r*r;
printf("Area = %f",ar);
getch();
}


CODING

OUTPUT

For any query or suggestion please comment below...

Thursday 31 January 2013

C PROGRAM: TO CALCULATE SIMPLE INTEREST

CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
float p,r,t,si;
clrscr();
printf("Enter principal amount ");
scanf("%f",&p);
printf("Enter rate of interest ");
scanf("%f",&r);
printf("Enter time ");
scanf("%f",&t);
si=(p*r*t)/100;
printf("Simple Interest = %f",si);
getch();
}


CODING

OUTPUT

For any query or suggestion please comment below...

C PROGRAM: TO PRINT TRIANGLE OF STARS

CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,p,s;
clrscr();
for(i=1;i<=5;i++)
{
 p=i;
 for(s=1;s<=6-i;s++)
 {
  printf("   ");         /* three spaces */
 }
 for(j=1;j<=(2*i-1);j++)
 {
  printf("  *");          /* two spaces */
 }
printf("\n\n");
}
getch();
}


CODING

OUTPUT
For any query or suggestion please comment below...

C PROGRAM: TO FIND SUM OF DIGITS OF A NUMBER

CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
int num,sum=0,n;
clrscr();
printf("Enter any integer value ");
scanf("%d",&num);
while(num>0)
{
 n=num%10;
 sum=sum+n;
 num=num/10;
}
printf("Sum of digits is = %d",sum);
getch();
}


CODING

OUTPUT


For any query or suggestion please comment below...

HOW TO REGISTER AVAST FREE ANTIVIRUS

AVAST antivirus is one of the best antivirus available for different types of OS like Windows, Mac, and android.It is easy to use and have attractive user interface.It protects more than 177,310,700 active devices around the globe.
Three types of avast antivirus are available : Avast Internet Security, Avast Pro Antivirus, and Avast Free Antivirus.You can see difference between these types in image given below:


Avast Free Antivirus is available for free and you can register it by following the steps given below:

1.Google search "avast official site" and on "Register avast! Free Antivirus" as shown in image OR directly open the "www.avast.com" and goto SUPPORT->License Center.



2.Fill details in form given on that page.


3.After filling all details, click on "Register for free license key" button.


Avast Free Antivirus license key will be sent to you by email in next 30 minutes.

For any query or suggestion please comment below...

Wednesday 30 January 2013

C PROGRAM: TO FIND HIGHEST NUMBER FROM N NUMBER OF TERMS


CODING:
#include<stdio.h>
#include<conio.h>
void main( )
{
int a[100],max,i,n;
clrscr( );
printf("Enter number of terms ");
scanf("%d",&n);
printf("Enter %d values ",n);
for(i=1;i<=n;i++)
{
 scanf("%d",&a[i]);
}
max=a[1];
for(i=2;i<=n;i++)
{
 if(max<a[i])
 max=a[i];
}
printf("Highest number = %d",max);
getch( );
}

CODING


OUTPUT
 For any query or suggestion please comment below....

C PROGRAM: TO CALCULATE ARITHMETIC MEAN OF EACH ROW OF MATRIX

CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10][10],m,n,i,j,sum;
double am[10];
clrscr();
printf("Enter order of matrix ");
scanf("%d%d",&m,&n);
printf("Enter values of matrix\n");
for(i=1;i<=m;i++)
{
 sum=0;
 for(j=1;j<=n;j++)
 {
  printf("Enter value of a[%d][%d] ",i,j);
  scanf("%d",&a[i][j]);
  sum=sum+a[i][j];
 }
 am[i]=(double)sum/n;
}
for(i=1;i<=m;i++)
{
  printf("\nArithmetic Mean of row %d = %f",i,am[i]);
}
getch();
}


CODING


OUTPUT


For any query or suggestion please comment below...

C PROGRAM: TO ADD TWO MATRICES USING ARRAY

CODING:
#include<stdio.h>
#include<conio.h>
void main( )
{
int a[10][10],b[10][10],c[10][10],m,n,i,j;
clrscr( );
printf("Enter order of matrices ");
scanf("%d%d",&m,&n);
printf("Enter values of first matrix\n);
for(i=1;i<=m;i++)
{
 for(j=1;j<=n;j++)
 {
  printf("Enter values of a[%d][%d] ",i,j);
  scanf("%d",&a[i][j]);
 }
}
printf(\nEnter values of second matrix\n);
for(i=1;i<=m;i++)
{
 for(j=1;j<=n;j++)
 {
  printf("Enter values of b[%d][%d] ",i,j);
  scanf("%d",&b[i][j]);
 }
}
for(i=1;i<=m;i++)
{
 for(j=1;j<=n;j++)
 {
  c[i][j]=a[i][j]+b[i][j];
  printf("\nSum of a[%d][%d] and b[%d][%d] = %d",i,j,i,j,c[i][j]);
 }
}
getch( );
}

----------------------------------------------------------------------------------------------------------------------------
OUTPUT:

OUTPUT WINDOW

For any query or suggestion please comment below....

C PROGRAM: TO PRINT TABLE OF ANY NUMBER UPTO N

CODING:
#include<stdio.h>
#include<conio.h>
void main( )
{
int num,n,i,mul;

clrscr( ); 
printf("Table of  ");           /*table of which number*/
scanf("%d",&num);
printf("Upto ");                /*table upto which number*/
scanf("%d",&n);
for(i=1;i<=n;i++)
{
 mul=num*i;
 printf("\n%d * %3d = %d",num,i,mul);
}
getch( );
}

CODING

OUTPUT


 For any query or suggestion please comment below....

C PROGRAM: TO CALCULATE SUM OF ELEMENTS BELOW MAIN DIAGONAL OF SQUARE MATRIX

CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10][10],m,i,j,sum=0;
clrscr();
printf("Enter order of square matrix ");
scanf("%d",&m);
printf("Enter values of matrix\n");
for(i=1;i<=m;i++)
{
 for(j=1;j<=m;j++)
 {
  printf("Enter value of a[%d][%d] ",i,j);
  scanf("%d",&a[i][j]);
 }
}
for(i=1;i<=m;i++)
{
 for(j=1;j<=m;j++)
 {
  if(i>j)
  sum=sum+a[i][j];
 }
}
printf("\nSum of elements below main daigonal of matrix = %d",sum);
getch();
}


CODING


OUTPUT

For any query or suggestion please comment below...

Tuesday 29 January 2013

C PROGRAM: TO ADD TWO FLOATING POINT NUMBERS

CODING:
#include<stdio.h>
#include<conio.h>
void main( )
{
float num1,num2,sum;
clrscr( );
printf("enter first number ");
scanf("%f",&num1);
printf("enter second number ");
scanf("%f",&num2);
sum=num1+num2;
printf("sum of two numbers= %f",sum);
getch( );
}


CODING
OUTPUT
NOTE: You can directly run program by pressing CTRL+F9.

For any query or suggestion please comment below...

C PROGRAM: TO CALCULATE SUM OF ELEMENTS OF MAIN DIAGONAL OF SQUARE MATRIX

CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10][10],m,i,j,sum=0;
clrscr();
printf("Enter order of square matrix ");
scanf("%d",&m);
printf("Enter values of matrix\n");
for(i=1;i<=m;i++)
{
 for(j=1;j<=m;j++)
 {
  printf("Enter value of a[%d][%d] ",i,j);
  scanf("%d",&a[i][j]);
 }
}
for(i=1;i<=m;i++)
{
 for(j=1;j<=m;j++)
 {
  if(i==j)
  sum=sum+a[i][j];
 }
}
printf("\nSum of elements of main daigonal of matrix = %d",sum);
getch();
}


CODING


OUTPUT


For any query or suggestion comment below...

C PROGRAM: TO CALCULATE SUM OF ELEMENTS ABOVE MAIN DAIGONAL OF SQUARE MATRIX

CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10][10],m,i,j,sum=0;
clrscr();
printf("Enter order of square matrix ");
scanf("%d",&m);
printf("Enter values of matrix\n");
for(i=1;i<=m;i++)
{
 for(j=1;j<=m;j++)
 {
  printf("Enter value of a[%d][%d] ",i,j);
  scanf("%d",&a[i][j]);
 }
}
for(i=1;i<=m;i++)
{
 for(j=1;j<=m;j++)
 {
  if(i<j)
  sum=sum+a[i][j];
 }
}
printf("\nSum of elements above main daigonal of matrix = %d",sum);
getch();
}


CODING


OUTPUT


For any query or suggestion please comment below...

C PROGRAM: TO CALCULATE FACTORIAL OF ANY NUMBER

CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
int num,i,fac;

clrscr();
printf("Enter any number ");
scanf("%d",&num);
fac=1;
for(i=1;i<=num;i++)
{
 fac=fac*i;
}
printf("\nFactorial of %d is =  %d",num,fac);
getch();
}


CODING


output image
OUTPUT

For any query or suggestion please comment below...

C PROGRAM: TO CALCULATE SUM OF N TERMS OF FIBONACCI SERIES

CODING:
#include<stdio.h>
#include<conio.h>
void main()
{
int pt,ct,nt,n,i,sum;

clrscr();
printf("Enter number of terms of fibonacci series ");
scanf("%d",&n);
pt=0;
ct=1;
sum=1;
for(i=1;i<=n-2;i++)
{
 nt=pt+ct;
 sum=sum+nt;
 pt=ct;
 ct=nt;
}
printf("\nSum of %d terms of Fibonacci series =  %d",n,sum);
getch();
}


CODING


OUTPUT


For any query or suggestion please comment below....

Monday 28 January 2013

HOW TO MAKE DISC IMAGE USING DAEMON TOOL

DAEMON Tools is a small but powerful software which is used to make disc image and mounting disc images in virtual drives( created by itself). Using this you can make exact boot-able copy of windows or other operating systems, game CD/DVD etc.
It can create disc images of following formats:
.mdx
.mds
.iso

And it can mount disc images with following formats:
.mdx
.mds
.mdf (Media Descriptor File)
.iso
.ccd (CloneCD)
.cue
.isz
.cdi (Discjuggler)
.b5t (BlindWrite 5)
.b6t
.bwt (Blindwrite)
.nrg (Nero)
.pdi (Instant CD/DVD)

DAEMON Tools Lite is available with free license for home use only, for commercial use you have to buy this software.To download this software pls visit its official site "http://www.daemon-tools.cc/eng/home".

Click here to know how to mount disc image

To make a disc image using DAEMON Tools follow steps given below:

 1. Insert disc into computer and open DAEMON Tool and click on "Make Disc Image".

 2. New window will open from which select disc image name, location and format as shown in 
     picture given below. 

 3. Then click on "start" button to start making disc image.

 4. Disc image making will start as shown below in picture. When disc image making finishes, click on "close" button.

NOTE: By default DAEMON Tool will save disc image in "C:\Users\Public\Documents\DAEMON Tools Images".


 For any query or suggestion please comment below...