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


Please Help Members By Posting Answers For Below Questions

Explain what is dynamic data structure?

642


How can I invoke another program or command and trap its output?

610


Explain how does free() know explain how much memory to release?

569


What does p mean in physics?

580


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

664






List some applications of c programming language?

545


What is n in c?

570


Is c weakly typed?

570


What is a stream in c programming?

588


What would happen to X in this expression: X += 15; (assuming the value of X is 5)

1293


What are high level languages like C and FORTRAN also known as?

680


Write a program to check prime number in c programming?

594


How can I direct output to the printer?

808


What is a spanning Tree?

947


When a c file is executed there are many files that are automatically opened what are they files?

589