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


Please Help Members By Posting Answers For Below Questions

Why is c so important?

592


How are structure passing and returning implemented?

588


What is static identifier?

701


Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

3051


How a string is stored in c?

583






What is conio h in c?

622


What does it mean when the linker says that _end is undefined?

625


Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

1889


What is the role of && operator in a program code?

564


What are the back slash character constants or escape sequence charactersavailable in c?

680


Which type of language is c?

642


What does %d do in c?

538


Why c is called free form language?

566


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

594


What is function what are the types of function?

554