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
Can you please explain the difference between strcpy() and memcpy() function?
Is c pass by value or reference?
what is different between auto and local static? why should we use local static?
What is dangling pointer in c?
If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER
what is the syallabus of computer science students in group- 1?
How many levels of pointers have?
C language questions for civil engineering
What does typeof return in c?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
What are the uses of null pointers?
Explain why C language is procedural?
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
Why is main function so important?