Saturday, February 9, 2013

what's the difference between api and web service

 An api is a collection of class which provide you some functionalities like google api gives you the opportunity to work with the google search.
See: http://en.wikipedia.org/wiki/API
Webservices on the otherhand are services available over internet. You can call these services and get so information or functionality in your application without actually having the classes or know how it works. For example weather webservices gives you information about the weather in a country and you don't get in contact with any classes.
See: http://en.wikipedia.org/wiki/Webservice

C Program To Find The Sum And Reverse Of A Number in c program

# include <stdio.h>
# include  <conio.h>
main()
{
 int num,tempsum;
 int sum=0;
 int reverse=0;
clrscr();
printf("Enter 5 digit no");
scanf("%d",&n);
while(num>0)
{
tempsum= num%10;
sum+=tempsum;
reverse=reverse*10+tempsum;
num=num/10;
}
printf("The sum of the digits is :%d",sum);
printf("the reverse of the no is %d",reverse);
getch();
}