If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.
Answer Posted / anil
#include<stdio.h>
#include<conio.h>
void main()
{
int num,first,last,total;
printf("enter the 4 digit number");
scanf("%d",&num);
first=num/1000;
last=num%10;
total=first+last;
printf("the total of first and last digit is %d",total);
getch();
}
Is This Answer Correct ? | 7 Yes | 4 No |
Post New Answer View All Answers
What is %lu in c?
What are the different types of errors?
What are the main characteristics of c language describe the structure of ac program?
How will you delete a node in DLL?
How many types of arrays are there in c?
What is the scope of an external variable in c?
Can a local variable be volatile in c?
What is getch () for?
Explain what are preprocessor directives?
What is integer constants?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
What are the 4 types of functions?
the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset
What do you know about the use of bit field?
How can I call fortran?