If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.
Answer Posted / anil
#include<stdio.h>
#include<conio.h>
void main()
{
int num,first,last,total;
printf("enter the 4 digit number");
scanf("%d",&num);
first=num/1000;
last=num%10;
total=first+last;
printf("the total of first and last digit is %d",total);
getch();
}
| Is This Answer Correct ? | 7 Yes | 4 No |
Post New Answer View All Answers
What is scope rule of function in c?
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
What is atoi and atof in c?
What are the valid places to have keyword “break”?
Describe the difference between = and == symbols in c programming?
What is the right type to use for boolean values in c?
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
What is identifiers in c with examples?
Can we compile a program without main() function?
What is variable and explain rules to declare variable in c?
pierrot's divisor program using c or c++ code
to find the closest pair
Can we replace the struct function in tree syntax with a union?
Is the exit() function same as the return statement? Explain.
The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?