Friday, October 29, 2010

c programs-sum of digit

#include
#include
void main()
{
int a[10];
int sum=0;
scanf("d",&n);
for(int i=0;i
{scanf("%d",&s[i]);
}
for(i=0;i
{
sum=sum+a[i];
}
  printf("%d",sum);
  getch();
  }

Wednesday, October 27, 2010

Quadratic equation

void main()
{ 
float a,b,c,d,s,x,y;

printf("Enetr the values of a,b,c");
scanf("%f %f %f",&a,&b,&c);
d=((b*b)-(4*a*c));
s=sqrt(d);
x= (-b+s)/(2*a);
y= (-b-s)/(2*a); 
printf("The quadratic equation is x=%f and y=%f",x,y);
getch(); 
}

factorial-c

void main()
{
int f=1,i,n;

printf(“Enter the value”);
scanf(“%d”,n);
for(i=1;i<=n;i++)
f=f*i;
printf("factorial of %d is %d",f);
getch();
}

Palindrome-c

void main() 
{
int n,sum=0,a,r;
printf("enter a num"); scanf("%d",&n);
a=n;
while(n>0)
{
r=n%10;
sum=sum*10+r;
n=n/10;
}
if(a==n)
printf("the num is palindrome");
else
printf("the num is not palindrome");
getch();
}

armstrong number-C


void main()
{
int n,b=0,a;
printf(“Enter the num”);
scanf(“%d”,&n);
a=n;
while(n>0)
{
r=n%10;
b=b+r*r*r;
n=n/10;
}
if(b==a)
{
printf(“it is a Armstrong num”);
}
else
{
printf(“is is Not an Armstrong num”);
}
getch();
}

Fibonacci series-c



void main()
{
int i=0,j=0,sum=1,n;
printf("Enter the number ");
scanf("%d",&n);
while(sum
{
printf("%d",sum);
i=j;
j=sum;
sum=i+j;
}

getch();
}

prime num-c


void main()
{
int n,i,count=0;
printf("enter a num");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
if(n%i==0)
{
count=count+1;
}
}
if(count<=2)
{
printf("it is prime number");
}
else
{
printf("it is not prime number");
}
getch();
}

perfect num-c


void main()
{
int n,i=1,sum=0;
printf("\nEnter a number:");
scanf("%d",&n);
while(i
{
if(n%i==0)
sum=sum+i;
i++;
}
if(sum==n)
printf("\nThe no %d is a perfect number",i);
else
printf("\nThe no %d is not a perfect number",i);
getch();
}

c programs-sum of digit


void main()
{
int n,i,sum=0,r;
printf("enter the value");
scanf("%d",&n);
for(i=0;i<=5;i++)
{
r=n%10;
n=n/10;
sum=sum+r;
}
getch();
}

Tuesday, October 26, 2010

application of computing

1.General Business
2. Process Manufacturing
3. Discrete Manufacturing –Purchasing, Accounting
4.Banking – Cost Control, ATM’s, Portfolio Analysis,Online Transactions, Cash flow analysis
5.Retail Sales – Customer Billing, Sales Analysis, Sales forecasting
6. Government – Budgeting, Elections, Tax collection, Licence & Permit, Welfare, Pollution control, Central Data Bank, Intelligence
7. Insurance – Customer Billing, Premium Accounting, Reserve Calculating,  Investment Analysis, Cash flow analysis.
8 .Transportation – Reservation system, Automatic rating, Rate calculation,Accounting.
9. Public Utilities – Customer Billing, Meter Reading, Rate Analysis, Operational simulation
10.Education – Attendence counting, computer based training, computer assisted instructions, Grading & scoring, Alumni Records, Online Library, Student History.