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 |
Why c is called a mid level programming language?
How many types of arrays are there in c?
Which command is more efficient? *(ptr+1) or ptr[1]
What is bin sh c?
What is alloca() and why is its use discouraged?
What is structure in c explain with example?
char ch="{'H','I',0};printf("%s",ch);what is output
Write a program for print infinite numbers
what is c
Explain the red-black trees?
Explain what is the difference between text files and binary files?
What are volatile variables?