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 / nikita singh

#include<stdio.h>
#include<conio.h>
void main()
{
int num,a,b,sum;
clrscr();
printf("enter a four digit no");
scanf("%d",&num);
a=num%10;
b=num/1000;
sum=a+b;
printf("sum is =%d",sum);
getch();
}

Is This Answer Correct ?    24 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is this loop always executing once?

1008


How can I run c program?

1136


What is the use of getchar() function?

1088


Tell me about low level programming languages.

1083


When should you use a type cast?

1068


What are the features of c languages?

1046


What is void main () in c?

1160


write a program to display all prime numbers

1926


Why c language?

1015


Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

1028


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

1115


given post order,in order construct the corresponding binary tree

2747


How can I remove the leading spaces from a string?

1113


Can we assign string to char pointer?

1055


What is difference between far and near pointers?

999