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

What are the different types of control structures in programming?

1088


Are the variables argc and argv are always local to main?

975


What is c language used for?

928


explain what is an endless loop?

1036


What is sizeof in c?

958


How will you delete a node in DLL?

1223


What the different types of arrays in c?

1025


In C programming, what command or code can be used to determine if a number of odd or even?

992


What are the two types of structure?

1042


Is printf a keyword?

1159


How many levels of pointers have?

991


Is Exception handling possible in c language?

1994


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

1012


What is a stream water?

1129


A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream

1120