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
What is the difference between a free-standing and a hosted environment?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
Where are c variables stored in memory?
Do you know pointer in c?
Is printf a keyword?
Is c a great language, or what?
Tell me about low level programming languages.
How can I manipulate strings of multibyte characters?
Which programming language is best for getting job 2020?
What is void pointers in c?
What is the use of function in c?
What is strcmp in c?
Do you know what are bitwise shift operators in c programming?
Write a program to reverse a linked list in c.
Why is c called "mother" language?