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 / jagannatha reddy

#include<stdio.h>
#include<conio.h>
void main()
{
int i,r,n,m=0;
clrscr();
printf("enter any 4 digit number");
scanf("%d",&n);
r=n%10;
for(i=1;i<=3;i++)
{
n=n/10;
}
printf("the sum is %d",(r+m));
}

Is This Answer Correct ?    5 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do you know the use of 'auto' keyword?

1129


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

1090


Do you know pointer in c?

992


Explain argument and its types.

992


What is && in c programming?

1111


Is swift based on c?

1053


Write a simple code fragment that will check if a number is positive or negative.

1100


What does c mean?

974


Write a program to identify if a given binary tree is balanced or not.

1091


Is c object oriented?

911


What is data structure in c and its types?

1018


Is array name a pointer?

994


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

1200


List the difference between a While & Do While loops?

1052


explain what is a newline escape sequence?

1040