If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.
Answer Posted / anvesh
#include<stdio.h>
main()
{
int n,n1,n4;
printf("Enter 4 digit number:");
scanf("%d",&n);
n4=n%10;
n1=n/100;
printf("\nResult=",(n1+n4));
getch();
}
Is This Answer Correct ? | 52 Yes | 55 No |
Post New Answer View All Answers
Who invented bcpl language?
Which is the best website to learn c programming?
how many key words availabel in c a) 28 b) 31 c) 32
my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?
Do string constants represent numerical values?
What is structure in c explain with example?
What is printf () in c?
What is strcpy() function?
Why are algorithms important in c program?
number of times a digit is present in a number
Tell us two differences between new () and malloc ()?
Does sprintf put null character?
What is int main () in c?
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
What is the stack in c?