If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.
Answer Posted / chirag
#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 ? | 30 Yes | 15 No |
Post New Answer View All Answers
Is c weakly typed?
Can a pointer be static?
Ow can I insert or delete a line (or record) in the middle of a file?
Is it better to use malloc() or calloc()?
What is call by reference in functions?
Explain what is the difference between #include and #include 'file' ?
What is data structure in c language?
What is openmp in c?
What is the use of volatile?
What is array of structure in c?
Explain what is a static function?
how to write optimum code to divide a 50 digit number with a 25 digit number??
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
What are the types of bitwise operator?
Compare interpreters and compilers.