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
What are the different types of control structures in programming?
Are the variables argc and argv are always local to main?
What is c language used for?
explain what is an endless loop?
What is sizeof in c?
How will you delete a node in DLL?
What the different types of arrays in c?
In C programming, what command or code can be used to determine if a number of odd or even?
What are the two types of structure?
Is printf a keyword?
How many levels of pointers have?
Is Exception handling possible in c language?
What is the difference between formatted&unformatted i/o functions?
What is a stream water?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream