If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.
Answer Posted / amrit bhujel
#include<stdio.h>
int main(void)
{
int num,a,b;
printf("enter 4 digit number");
scanf("%d",&num);
a=num/1000;
b=num%10;
printf("the num is %d %d",a,b);
return 0;
}
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
Explain what are reserved words?
What is data type long in c?
Do you have any idea about the use of "auto" keyword?
What are the benefits of organizational structure?
What are the types of data types and explain?
Is it possible to execute code even after the program exits the main() function?
Is c object oriented?
find the sum of two matrices and WAP for it.
Describe the modifier in c?
What are the advantages and disadvantages of c language?
Disadvantages of C language.
How many levels of pointers can you have?
What are valid operations on pointers?
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..
Why is c called a mid-level programming language?