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

#include<stdio.h>
#include<conio.h>
void main()
{
int num,first,last,total;
printf("enter the 4 digit number");
scanf("%d",&num);
first=num/1000;
last=num%10;
total=first+last;
printf("the total of first and last digit is %d",total);
getch();
}

Is This Answer Correct ?    7 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE

1963


What are the advantages of using macro in c language?

1081


what are # pragma staments?

2007


Explain how do you determine whether to use a stream function or a low-level function?

1037


What is string function c?

974


void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply

2713


What are the properties of union in c?

1010


What is indirection?

1043


Write the control statements in C language

1141


When should volatile modifier be used?

967


When should the volatile modifier be used?

1117


#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }

1113


Explain what is wrong with this program statement?

1073


What is the best way of making my program efficient?

975


What is a class c rental property?

1057