If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.
Answer Posted / nikita singh
#include<stdio.h>
#include<conio.h>
void main()
{
int num,a,b,sum;
clrscr();
printf("enter a four digit no");
scanf("%d",&num);
a=num%10;
b=num/1000;
sum=a+b;
printf("sum is =%d",sum);
getch();
}
| Is This Answer Correct ? | 24 Yes | 15 No |
Post New Answer View All Answers
Why is this loop always executing once?
How can I run c program?
What is the use of getchar() function?
Tell me about low level programming languages.
When should you use a type cast?
What are the features of c languages?
What is void main () in c?
write a program to display all prime numbers
Why c language?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
Write a simple code fragment that will check if a number is positive or negative.
given post order,in order construct the corresponding binary tree
How can I remove the leading spaces from a string?
Can we assign string to char pointer?
What is difference between far and near pointers?