If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.
Answer Posted / jagannatha reddy
#include<stdio.h>
#include<conio.h>
void main()
{
int i,r,n,m=0;
clrscr();
printf("enter any 4 digit number");
scanf("%d",&n);
r=n%10;
for(i=1;i<=3;i++)
{
n=n/10;
}
printf("the sum is %d",(r+m));
}
| Is This Answer Correct ? | 5 Yes | 5 No |
Post New Answer View All Answers
Do you know the use of 'auto' keyword?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
Do you know pointer in c?
Explain argument and its types.
What is && in c programming?
Is swift based on c?
Write a simple code fragment that will check if a number is positive or negative.
What does c mean?
Write a program to identify if a given binary tree is balanced or not.
Is c object oriented?
What is data structure in c and its types?
Is array name a pointer?
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?
List the difference between a While & Do While loops?
explain what is a newline escape sequence?