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


Please Help Members By Posting Answers For Below Questions

write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

1544


Is multithreading possible in c?

651


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

740


What is #define size in c?

751


How arrays can be passed to a user defined function

672






Why c is called procedure oriented language?

685


What is quick sort in c?

696


Write a function that will take in a phone number and output all possible alphabetical combinations

694


Can we replace the struct function in tree syntax with a union?

890


What is the symbol indicated the c-preprocessor?

840


Explain how do you determine the length of a string value that was stored in a variable?

768


Wt are the Buses in C Language

2850


What are all different types of pointers in c?

679


What is c method?

622


what are the different storage classes in c?

754