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

What is scope rule of function in c?

1149


How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?

1074


What is atoi and atof in c?

1133


What are the valid places to have keyword “break”?

1144


Describe the difference between = and == symbols in c programming?

1449


What is the right type to use for boolean values in c?

1085


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

2458


What is identifiers in c with examples?

1240


Can we compile a program without main() function?

1179


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

1175


pierrot's divisor program using c or c++ code

2284


to find the closest pair

2370


Can we replace the struct function in tree syntax with a union?

1353


Is the exit() function same as the return statement? Explain.

1157


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

1322