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
In C language what is a 'dangling pointer'?
What is keyword with example?
Explain continue keyword in c
Explain how do you determine the length of a string value that was stored in a variable?
What is a void pointer? When is a void pointer used?
What is the difference between formatted&unformatted i/o functions?
design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
With the help of using classes, write a program to add two numbers.
How can you call a function, given its name as a string?
Which function in C can be used to append a string to another string?
What is %lu in c?
diff between exptected result and requirement?
What is array within structure?
Explain how do you use a pointer to a function?