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


Please Help Members By Posting Answers For Below Questions

What is the function of this pointer?

679


What is #line in c?

565


write a program to rearrange the array such way that all even elements should come first and next come odd

1766


What is a void * in c?

602


What are the 5 organizational structures?

571






What is linear search?

678


What is define directive?

644


When should the volatile modifier be used?

689


What is floating point constants?

695


How can I read/write structures from/to data files?

554


What does the characters “r” and “w” mean when writing programs that will make use of files?

862


Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

1659


How can you avoid including a header more than once?

568


Is null valid for pointers to functions?

616


What is the difference between the local variable and global variable in c?

535