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 are different types of variables in c?
Create a simple code fragment that will swap the values of two variables num1 and num2.
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
What is the difference between struct and typedef struct in c?
Explain what is the difference between a string and an array?
What is the difference between void main and main in c?
What is the stack in c?
What is the use of ?: Operator?
What is an auto keyword in c?
Explain how can I open a file so that other programs can update it at the same time?
Is fortran still used today?
Write a program that accept anumber in words
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
What is a const pointer?
What is equivalent to ++i+++j?