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
What is null character in c?
Why static is used in c?
What language is windows 1.0 written?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
What is table lookup in c?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
What's a good way to check for "close enough" floating-point equality?
Write a program to swap two numbers without using the third variable?
Explain the use of keyword 'register' with respect to variables.
Explain about C function prototype?
What are logical errors and how does it differ from syntax errors?
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
Why is c faster?
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
Why should I prototype a function?