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

i want to know the procedure of qualcomm for getting a job through offcampus

2425


Is it possible to have a function as a parameter in another function?

1050


What is typedef?

1349


Write a progarm to find the length of string using switch case?

2041


How do we declare variables in c?

1022


Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?

995


Hai what is the different types of versions and their differences

1909


FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above

1081


Explain the red-black trees?

1076


Explain why C language is procedural?

1171


What is union in c?

1075


How to write a code for implementing my own printf() and scanf().... Please hep me in this... I need a guidance... Can you give an coding for c... Please also explain about the header files used other than #include...

5416


Why cant I open a file by its explicit path?

1008


Why is struct padding needed?

1042


What does %p mean?

1041