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 / sourav sinha

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int num,n1,n2,sum;
clrscr();
printf("Enter 4 digit number:");
scanf("%d",&num);
n1=num/1000;
n2=num%10;
sum=n1+n2;
printf("Sum of 1st & 4th digit number is=%d",sum);
getch();
}
enjoy!!!!!!!!!!!!

any program just mail me:
ssmartinp@gmail.com

Is This Answer Correct ?    57 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of function overloading in C?

1100


Difference between MAC vs. IP Addressing

1095


What is variable and explain rules to declare variable in c?

1017


What would happen to X in this expression: X += 15; (assuming the value of X is 5)

1883


can anyone please tell about the nested interrupts?

2064


Difference between pass by reference and pass by value?

1097


Can we assign string to char pointer?

1041


Explain the process of converting a Tree into a Binary Tree.

2608


What is string in c language?

1075


what is the significance of static storage class specifier?

2185


what do u mean by Direct access files? then can u explain about Direct Access Files?

2031


What are the application of void data type in c?

1133


What is the difference between malloc() and calloc()?

1692


How can I write a function analogous to scanf?

1099


What is define directive?

1074