If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.
Answer Posted / bharghavi
#
#
void main()
{
int num,n1,n2,sum;
cout<<"enter a 4 digit no.";
cin>>num;
n1=num/1000;
n2=num%10;
sum=n1+n2;
cout<<"sum of 1st & 4th digit is"<<sum;
}
Is This Answer Correct ? | 129 Yes | 35 No |
Post New Answer View All Answers
Can you please explain the difference between strcpy() and memcpy() function?
What is the function of this pointer?
Why is it that not all header files are declared in every C program?
What math functions are available for integers? For floating point?
What is structure of c program?
Who is the founder of c language?
What type of function is main ()?
What is floating point constants?
What is getch() function?
If you know then define #pragma?
The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.
What is the correct declaration of main?
When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.
Explain how can I open a file so that other programs can update it at the same time?
What are the data types present in c?