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
Tell me when would you use a pointer to a function?
What are the two types of functions in c?
What is the use of extern in c?
What do you understand by normalization of pointers?
Why does notstrcat(string, "!");Work?
What are near, far and huge pointers?
Explain the bubble sort algorithm.
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
How do you define CONSTANT in C?
What is #pragma statements?
What is output redirection?
What are the advantages of using linked list for tree construction?
Write the syntax and purpose of a switch statement in C.
What is the difference between union and structure in c?
In a byte, what is the maximum decimal number that you can accommodate?