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

Why c is called a mid level programming language?

0 Answers  


How many types of arrays are there in c?

0 Answers  


Which command is more efficient? *(ptr+1) or ptr[1]

3 Answers  


What is bin sh c?

0 Answers  


What is alloca() and why is its use discouraged?

1 Answers  


What is structure in c explain with example?

0 Answers  


char ch="{'H','I',0};printf("%s",ch);what is output

9 Answers   Accenture,


Write a program for print infinite numbers

3 Answers   Wipro,


what is c

4 Answers  


Explain the red-black trees?

0 Answers  


Explain what is the difference between text files and binary files?

0 Answers  


What are volatile variables?

1 Answers   Mind Tree,


Categories