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

Answer Posted / amrit bhujel

#include<stdio.h>
int main(void)
{
int num,a,b;
printf("enter 4 digit number");
scanf("%d",&num);
a=num/1000;
b=num%10;
printf("the num is %d %d",a,b);
return 0;
}

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how many levels deep can include files be nested?

714


Explain what will be the outcome of the following conditional statement if the value of variable s is 10?

855


What is the purpose of void pointer?

686


Is main is a keyword in c?

712


#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }

832






What is #include stdio h?

786


Is boolean a datatype in c?

651


diff between exptected result and requirement?

1685


What are compound statements?

722


What is a good way to implement complex numbers in c?

693


What is the use of sizeof?

653


Explain what is the advantage of a random access file?

785


What is the difference between ā€˜gā€™ and ā€œgā€ in C?

3145


I need a sort of an approximate strcmp routine?

739


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

867