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 main function is special give two reasons?
what are bit fields in c?
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??
Why flag is used in c?
Which function in C can be used to append a string to another string?
formula to convert 2500mmh2o into m3/hr
What are the preprocessor categories?
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
What is #include conio h?
What are structures and unions? State differencves between them.
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
What are global variables and explain how do you declare them?
How can my program discover the complete pathname to the executable from which it was invoked?
What are the different types of C instructions?