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

#include<stdio.h>
main()
{
int n,n1,n4,z;
printf("Enter 4 digit number:");
scanf("%d",&n);
n4=n%10;
n1=n/1000;
z=n1+n4;
printf("Result=%d",z);
system("pause");
}

Is This Answer Correct ?    11 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is c called "mother" language?

1282


What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }

2490


What is union and structure?

1115


Explain how do you print an address?

1143


What are logical errors and how does it differ from syntax errors?

1293


Write programs for String Reversal & Palindrome check

1056


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

1253


What do you mean by command line argument?

1167


What does the format %10.2 mean when included in a printf statement?

1645


What is the difference between malloc() and calloc()?

1840


illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question

2071


Compare array data type to pointer data type

1018


What are the 4 types of functions?

1050


Does c have function or method?

991


Once I have used freopen, how can I get the original stdout (or stdin) back?

1073