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.

Answers were Sorted based on User's Feedback



If 4 digits number is input through the keyboard, Write a program to calculate sum of its 1st &..

Answer / anvesh

#include<stdio.h>
main()
{
int n,n1,n4;
printf("Enter 4 digit number:");
scanf("%d",&n);
n4=n%10;
n1=n/100;
printf("\nResult=",(n1+n4));
getch();
}

Is This Answer Correct ?    52 Yes 55 No

If 4 digits number is input through the keyboard, Write a program to calculate sum of its 1st &..

Answer / kadher masthan ,...sit

thiz z how 2 find the sum of first and last digit of any
number

#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
long int n,nf,nl,temp;
int count=-1;
printf("Enter a number:");
scanf("%ld",&n);
temp =n;
while(temp<0)
{
temp=temp/10;
c++;
}
nl=n%10;
nf=n/(pow(10,c));
printf("\n%ldResult=",(nf+nl));
getch();
}

Is This Answer Correct ?    9 Yes 23 No

Post New Answer

More C Interview Questions

Meaning of () in c

1 Answers  


count the numbers between 100 and 300, that star with 2 and ends with 2

5 Answers   Mind Tree,


Is struct oop?

0 Answers  


How can I find the modification date and time of a file?

0 Answers  


What is volatile keyword in c?

0 Answers  


What is wrong with this program statement? void = 10;

0 Answers  


What is the function of volatile in c language?

0 Answers  


write a program to print infinte number

4 Answers  


what is the significance of static storage class specifier?

0 Answers  


Can we change the value of static variable in c?

0 Answers  


What is strcpy() function?

0 Answers  


Juxtapose the use of override with new. What is shadowing?

1 Answers  


Categories