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
i want to know the procedure of qualcomm for getting a job through offcampus
Is it possible to have a function as a parameter in another function?
What is typedef?
Write a progarm to find the length of string using switch case?
How do we declare variables in c?
Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?
Hai what is the different types of versions and their differences
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above
Explain the red-black trees?
Explain why C language is procedural?
What is union in c?
How to write a code for implementing my own printf() and
scanf().... Please hep me in this... I need a guidance...
Can you give an coding for c... Please also explain about
the header files used other than #include
Why cant I open a file by its explicit path?
Why is struct padding needed?
What does %p mean?