Friday, 31 May 2013

    C program to check a number is perfect number or not A number which is equal to the sum of its divisor is called perfect number.For eg,divisors of 6 are 1,2 and 3.The sum of these divisors is 6.So 6 is called as perfect number. #include<stdio.h>#include<conio.h> //perfect number checkingvoid main(){    int n,d,sum;    clrscr();    printf("\n Enter the number : ");    scanf("%d",&n);    sum = 0;   ...

Friday, 31 May 2013 by Partha Roy · 0

Wednesday, 26 December 2012

Any base to any base conversion

The Program for any base to any base conversion: This program converts a given number in any base(2,8,10,16) to any base that user wants.here we use two functions one is  "other_to_decimal" which is for converting a number from any base to decimal,; and other is "decimal_to_other" which is for converting a number from decimal...

Wednesday, 26 December 2012 by Partha Roy · 4

Any base to Decimal conversion:

Program for Any base to Decimal conversion: This program shows how to convert a number in any base(it can be 2, 7..) to decimal number system.The user enters the number and its base and the program converts it to decimal system. //any base to decimal converting .... #include<stdio.h> #include<conio.h> void main() { long...

by Partha Roy · 0

Decimal to any number system conversion:

The program for Decimal to any base conversion: This program converts a decimal number to any base that user wants.. The User at first , enters the the number and the output base and the program converts the decimal number to the wanted base. //Decimal to any base.... #include<stdio.h> #include<conio.h> void main() { int...

by Partha Roy · 1

Monday, 24 December 2012

Printing the Pascal Triangle:

Program for the Pascal Triangle: //Pascal triangle... #include<stdio.h> #include<conio.h> void main() { int p[10][10]; int i,j,row,m,n; clrscr(); printf("Enter the number of rows you want to get printed:"); scanf("%d",&row); p[0][0]=1; p[1][0]=1; p[1][1]=1; for(i=2;i<row;i++) { for(j=0;j<=i;j++) { if(j==0) ...

Monday, 24 December 2012 by Partha Roy · 0

Printing the Fibonacci series:

Program for Printing the Fibonacci series: #include<stdio.h> #include<conio.h> void main() { int a,b,c,range,i=2; clrscr(); printf("Enter How many numbers you want to get printed:"); scanf("%d",&range); a=0; b=1; printf("%d,%d",a,b); while(i!=range) { c=a+b; a=b; b=c; i=i+1; printf(",%d",c); } getch(); } and...

by Partha Roy · 0

The permutation of a three(3) digit number

The Program for the permutation of a three(3) digit number: //the permutation of a three(3) digit number... #include<stdio.h> #include<conio.h> void main() { int i,j,k,l,m,len=0,num[3],n; clrscr; printf("enter any three digit number:"); scanf("%d",&k); m=k; while(m!=0) { m=m/10; len++; } if(len==3) { num[0]=k/100; num[1]=(k%100)/10; num[2]=(k%100)%10; for(i=0;i<3;i++) { ...

by Partha Roy · 0

Recent Comments

All Rights Reserved Assignments on C language