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
When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
What is calloc malloc realloc in c?
how many key words availabel in c a) 28 b) 31 c) 32
What is 1d array in c?
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
How do c compilers work?
What are extern variables in c?
what is different between auto and local static? why should we use local static?
write a program to concatenation the string using switch case?
What is the purpose of 'register' keyword in c language?
What are the different file extensions involved when programming in C?
Can one function call another?
Are enumerations really portable?
What is the use of getchar() function?
Explain data types & how many data types supported by c?