If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.
Answer Posted / sourav sinha
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int num,n1,n2,sum;
clrscr();
printf("Enter 4 digit number:");
scanf("%d",&num);
n1=num/1000;
n2=num%10;
sum=n1+n2;
printf("Sum of 1st & 4th digit number is=%d",sum);
getch();
}
enjoy!!!!!!!!!!!!
any program just mail me:
ssmartinp@gmail.com
| Is This Answer Correct ? | 57 Yes | 15 No |
Post New Answer View All Answers
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
What is the role of this pointer?
What is graph in c?
What is malloc() function?
Explain how do you print an address?
What are the types of c language?
Can 'this' pointer by used in the constructor?
What is the difference between NULL and NUL?
What is the general form of a C program?
How do you list a file’s date and time?
What functions are used for dynamic memory allocation in c language?
Is return a keyword in c?
What is sizeof int?
What is getche() function?
What are the 4 types of functions?