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 / kadher masthan ,...sit

thiz z how 2 find the sum of first and last digit of any
number

#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
long int n,nf,nl,temp;
int count=-1;
printf("Enter a number:");
scanf("%ld",&n);
temp =n;
while(temp<0)
{
temp=temp/10;
c++;
}
nl=n%10;
nf=n/(pow(10,c));
printf("\n%ldResult=",(nf+nl));
getch();
}

Is This Answer Correct ?    9 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In C language what is a 'dangling pointer'?

1065


What is keyword with example?

1015


Explain continue keyword in c

965


Explain how do you determine the length of a string value that was stored in a variable?

1096


What is a void pointer? When is a void pointer used?

1024


What is the difference between formatted&unformatted i/o functions?

1011


design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.

1926


In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none

1161


With the help of using classes, write a program to add two numbers.

986


How can you call a function, given its name as a string?

1102


Which function in C can be used to append a string to another string?

1181


What is %lu in c?

1180


diff between exptected result and requirement?

1994


What is array within structure?

1064


Explain how do you use a pointer to a function?

1056