If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.
Answer Posted / anvesh
#include<stdio.h>
main()
{
int n,n1,n4;
printf("Enter 4 digit number:");
scanf("%d",&n);
n4=n%10;
n1=n/100;
printf("\nResult=",(n1+n4));
getch();
}
| Is This Answer Correct ? | 52 Yes | 55 No |
Post New Answer View All Answers
What is the time and space complexities of merge sort and when is it preferred over quick sort?
How can I sort more data than will fit in memory?
If null and 0 are equivalent as null pointer constants, which should I use?
how can I convert a string to a number?
What are file streams?
Write a program to implement queue.
What is pass by value in c?
What is the scope of static variable in c?
Where local variables are stored in c?
Does c have enums?
What is a nested formula?
Explain a file operation in C with an example.
List out few of the applications that make use of Multilinked Structures?
What is linear search?
Why C language is a procedural language?