If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.

Answer Posted / sourav sinha

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int num,n1,n2,sum;
clrscr();
printf("Enter 4 digit number:");
scanf("%d",&num);
n1=num/1000;
n2=num%10;
sum=n1+n2;
printf("Sum of 1st & 4th digit number is=%d",sum);
getch();
}
enjoy!!!!!!!!!!!!

any program just mail me:
ssmartinp@gmail.com

Is This Answer Correct ?    57 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the mean of function?

754


What is a nested loop?

750


Explain low-order bytes.

714


Explain what are linked list?

716


Explain the difference between strcpy() and memcpy() function?

679






What is sizeof int?

726


What is the method to save data in stack data structure type?

716


How main function is called in c?

712


What does the function toupper() do?

750


Can you please explain the difference between malloc() and calloc() function?

720


Explain 'bus error'?

670


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

736


Explain how can I write functions that take a variable number of arguments?

691


write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays

1879


Which is best linux os?

656