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
what is different between auto and local static? why should we use local static?
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?
What is the c language function prototype?
What is the purpose of & in scanf?
what is uses of .net
What is the difference between union and anonymous union?
Is there a way to compare two structure variables?
What is the difference between #include and #include 'file' ?
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
What are the 5 types of inheritance in c ++?
Write a program to swap two numbers without using third variable?
What is null pointer in c?
What is the role of this pointer?
What are global variables and how do you declare them?
What is break statement?