If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.
Answer Posted / sourav sinha
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int num,n1,n2,sum;
clrscr();
printf("Enter 4 digit number:");
scanf("%d",&num);
n1=num/1000;
n2=num%10;
sum=n1+n2;
printf("Sum of 1st & 4th digit number is=%d",sum);
getch();
}
enjoy!!!!!!!!!!!!
any program just mail me:
ssmartinp@gmail.com
Is This Answer Correct ? | 57 Yes | 15 No |
Post New Answer View All Answers
Explain what is dynamic data structure?
How can I invoke another program or command and trap its output?
Explain how does free() know explain how much memory to release?
What does p mean in physics?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
List some applications of c programming language?
What is n in c?
Is c weakly typed?
What is a stream in c programming?
What would happen to X in this expression: X += 15; (assuming the value of X is 5)
What are high level languages like C and FORTRAN also known as?
Write a program to check prime number in c programming?
How can I direct output to the printer?
What is a spanning Tree?
When a c file is executed there are many files that are automatically opened what are they files?