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 |
What are inbuilt functions in c?
i got 75% in all semester am i eligible for your company
write a program to find the largest and second largest integer from an array
What is a class c rental property?
When should a type cast not be used?
Write a program that receives as input a number omaadel-n-print, four digits.
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
Explain how many levels deep can include files be nested?
write a prgram of swapping with 2 valiables
Describe dynamic data structure in c programming language?
What is the g value paradox?
find a number whether it is even or odd without using any control structures and relational operators?
22 Answers Microsoft, Shashank Private Limited,