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 |
write a program to gat the digt sum of a number (et. 15= >1+5=6)
What are the types of pointers?
c program to arrange digits in a no in ascending and descending order
What are the application of c?
Can a void pointer point to a function?
What are the different data types in C?
What is the difference between i++ and i+1 ?(in terms of memory)
What is the usage of the pointer in c?
How do you initialize function pointers? Give an example?
What is the difference between null pointer and wild pointer?
How do I use void main?
Explain the difference between fopen() and freopen().