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
Why is c fast?
How many types of functions are there in c?
Is main is user defined function?
How can you access memory located at a certain address?
what do u mean by Direct access files? then can u explain about Direct Access Files?
Place the #include statement must be written in the program?
What oops means?
What is typedef example?
write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare. You will then tabulate this information in another file.
What does %d do?
ATM machine and railway reservation class/object diagram
What are header files? What are their uses?
What is a null pointer in c?
Are pointers really faster than arrays?
what is bit rate & baud rate? plz give wave forms