If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.
Answer Posted / 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 |
Post New Answer View All Answers
write a program to rearrange the array such way that all even elements should come first and next come odd
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
Why is this loop always executing once?
How is = symbol different from == symbol in c programming?
How main function is called in c?
What are header files why are they important?
What is the sizeof () operator?
#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }
What are the 5 data types?
Can a variable be both static and volatile in c?
Explain how do you override a defined macro?
When c language was developed?
What is logical error?
How a string is stored in c?
What functions are used for dynamic memory allocation in c language?