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
Why is c called "mother" language?
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
What is union and structure?
Explain how do you print an address?
What are logical errors and how does it differ from syntax errors?
Write programs for String Reversal & Palindrome check
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
What do you mean by command line argument?
What does the format %10.2 mean when included in a printf statement?
What is the difference between malloc() and calloc()?
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
Compare array data type to pointer data type
What are the 4 types of functions?
Does c have function or method?
Once I have used freopen, how can I get the original stdout (or stdin) back?