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

When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?

818


What is calloc malloc realloc in c?

602


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

641


What is 1d array in c?

615


If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above

630






How do c compilers work?

621


What are extern variables in c?

557


what is different between auto and local static? why should we use local static?

652


write a program to concatenation the string using switch case?

1568


What is the purpose of 'register' keyword in c language?

638


What are the different file extensions involved when programming in C?

776


Can one function call another?

640


Are enumerations really portable?

602


What is the use of getchar() function?

639


Explain data types & how many data types supported by c?

592