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

#include<stdio.h>
#include<conio.h>
void main()
{
int num,a,b,sum;
clrscr();
printf("enter a four digit no");
scanf("%d",&num);
a=num%10;
b=num/1000;
sum=a+b;
printf("sum is =%d",sum);
getch();
}

Is This Answer Correct ?    30 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c weakly typed?

1073


Can a pointer be static?

1130


Ow can I insert or delete a line (or record) in the middle of a file?

1048


Is it better to use malloc() or calloc()?

1174


What is call by reference in functions?

1538


Explain what is the difference between #include and #include 'file' ?

1079


What is data structure in c language?

1161


What is openmp in c?

1067


What is the use of volatile?

1150


What is array of structure in c?

1253


Explain what is a static function?

1157


how to write optimum code to divide a 50 digit number with a 25 digit number??

3298


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

1131


What are the types of bitwise operator?

1164


Compare interpreters and compilers.

1115