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 |
Are bit fields portable?
How does free() know how many bytes to free?
What are header files and what are its uses in C programming?
Write a program using two-dimensional array that lists the odd numbers and even numbers separately in a 12 input values.
Can static variables be declared in a header file?
Write a C program to perform some of the operation which can be performed using Single linked list
What is use of null pointer in c?
write a program to compare 2 numbers without using logical operators?
wat s the meaning of (int *)p +4;
what is the difference between structure and union?
write a pgm to print 1 1 2 1 1 2 3 2 1 1 2 3 4 3 2 1
How can I ensure that integer arithmetic doesnt overflow?