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 is the difference between variable declaration and variable definition in c?
Can an array be an Ivalue?
Explain what is the difference between declaring a variable and defining a variable?
how could explain about job profile
How to receive strings with spaces in scanf()
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon
How to print India by nested loop? I IN IND INDI INDIA
Do you know the purpose of 'register' keyword?
Can a pointer be static?
which one is better structure or union?(other than the space occupied )
in C-programming language without using printf statement can we get output r not ? if yes how and if no also how ?
How can I check whether a file exists? I want to warn the user if a requested input file is missing.