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
Is c a great language, or what?
What are the two types of functions in c?
How can a string be converted to a number?
How main function is called in c?
application attempts to perform an operation?
How to find a missed value, if you want to store 100 values in a 99 sized array?
Why header file is used in c?
Sir i need notes for structure,functions,pointers in c language can you help me please
Explain continue keyword in c
How are variables declared in c?
What is a structure in c language. how to initialise a structure in c?
write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?
What is the difference between variable declaration and variable definition in c?
Write a program for Overriding.
What is a dynamic array in c?