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


Please Help Members By Posting Answers For Below Questions

Who invented bcpl language?

810


Which is the best website to learn c programming?

700


how many key words availabel in c a) 28 b) 31 c) 32

715


my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?

1235


Do string constants represent numerical values?

1014






What is structure in c explain with example?

739


What is printf () in c?

669


What is strcpy() function?

762


Why are algorithms important in c program?

717


number of times a digit is present in a number

1627


Tell us two differences between new () and malloc ()?

711


Does sprintf put null character?

690


What is int main () in c?

723


What is Dynamic memory allocation in C? Name the dynamic allocation functions.

700


What is the stack in c?

800