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
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 |
Meaning of () in c
count the numbers between 100 and 300, that star with 2 and ends with 2
Is struct oop?
How can I find the modification date and time of a file?
What is volatile keyword in c?
What is wrong with this program statement? void = 10;
What is the function of volatile in c language?
write a program to print infinte number
what is the significance of static storage class specifier?
Can we change the value of static variable in c?
What is strcpy() function?
Juxtapose the use of override with new. What is shadowing?