If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.
Answer Posted / vinay
#include<stdio.h>
main()
{
int n,n1,n4,z;
printf("Enter 4 digit number:");
scanf("%d",&n);
n4=n%10;
n1=n/1000;
z=n1+n4;
printf("Result=%d",z);
system("pause");
}
| Is This Answer Correct ? | 11 Yes | 6 No |
Post New Answer View All Answers
Is it better to use malloc() or calloc()?
What is the use of define in c?
Was 2000 a leap year?
Do you know the use of 'auto' keyword?
What is property type c?
What are the types of pointers?
Explain what is a static function?
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???
What are Macros? What are its advantages and disadvantages?
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
How do I determine whether a character is numeric, alphabetic, and so on?
Tell me when is a void pointer used?
Can you write the algorithm for Queue?
How can I ensure that integer arithmetic doesnt overflow?
What is function in c with example?