Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.

Answer Posted / vinay

#include<stdio.h>
main()
{
int n,n1,n4,z;
printf("Enter 4 digit number:");
scanf("%d",&n);
n4=n%10;
n1=n/1000;
z=n1+n4;
printf("Result=%d",z);
system("pause");
}

Is This Answer Correct ?    11 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it better to use malloc() or calloc()?

1178


What is the use of define in c?

1104


Was 2000 a leap year?

1091


Do you know the use of 'auto' keyword?

1267


What is property type c?

1137


What are the types of pointers?

1189


Explain what is a static function?

1160


why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???

2028


What are Macros? What are its advantages and disadvantages?

1222


Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

2099


How do I determine whether a character is numeric, alphabetic, and so on?

1186


Tell me when is a void pointer used?

1241


Can you write the algorithm for Queue?

2175


How can I ensure that integer arithmetic doesnt overflow?

1256


What is function in c with example?

1230