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

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

638


An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?

665


What is the c language function prototype?

642


What is the purpose of & in scanf?

589


what is uses of .net

1273






What is the difference between union and anonymous union?

833


Is there a way to compare two structure variables?

615


What is the difference between #include and #include 'file' ?

602


program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)

1620


What are the 5 types of inheritance in c ++?

576


Write a program to swap two numbers without using third variable?

812


What is null pointer in c?

589


What is the role of this pointer?

545


What are global variables and how do you declare them?

614


What is break statement?

629