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
Why is c so popular?
What is a char c?
What is meant by int main ()?
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
how can use subset in c program and give more example
How #define works?
Can i use “int” data type to store the value 32768? Why?
Why clrscr is used after variable declaration?
What is #define?
Why do we use header files in c?
Why do we use null pointer?
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
What is the difference between char array and char pointer?
What is dynamic dispatch in c++?
write a program to concatenation the string using switch case?