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 / anvesh

#include<stdio.h>
main()
{
int n,n1,n4;
printf("Enter 4 digit number:");
scanf("%d",&n);
n4=n%10;
n1=n/100;
printf("\nResult=",(n1+n4));
getch();
}

Is This Answer Correct ?    52 Yes 55 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the time and space complexities of merge sort and when is it preferred over quick sort?

1073


How can I sort more data than will fit in memory?

1099


If null and 0 are equivalent as null pointer constants, which should I use?

1210


how can I convert a string to a number?

1080


What are file streams?

1010


Write a program to implement queue.

1108


What is pass by value in c?

1067


What is the scope of static variable in c?

1015


Where local variables are stored in c?

999


Does c have enums?

1098


What is a nested formula?

1144


Explain a file operation in C with an example.

1118


List out few of the applications that make use of Multilinked Structures?

2187


What is linear search?

1132


Why C language is a procedural language?

1021