If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.

Answer Posted / vinay

#include<stdio.h>
main()
{
int n,n1,n4,z;
printf("Enter 4 digit number:");
scanf("%d",&n);
n4=n%10;
n1=n/1000;
z=n1+n4;
printf("Result=%d",z);
system("pause");
}

Is This Answer Correct ?    11 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.

1538


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

641


Can you subtract pointers from each other? Why would you?

568


Can you tell me how to check whether a linked list is circular?

783


What standard functions are available to manipulate strings?

570






What is the use of bit field?

652


What is function definition in c?

595


Can a pointer point to null?

594


please give me some tips for the placement in the TCS.

1641


How do I get an accurate error status return from system on ms-dos?

655


What is main function in c?

556


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

628


What is file in c language?

585


What does a pointer variable always consist of?

671


What is #error and use of it?

688