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


Please Help Members By Posting Answers For Below Questions

Why is c so popular?

654


What is a char c?

596


What is meant by int main ()?

722


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?

2177


how can use subset in c program and give more example

1507






How #define works?

623


Can i use “int” data type to store the value 32768? Why?

758


Why clrscr is used after variable declaration?

1045


What is #define?

578


Why do we use header files in c?

587


Why do we use null pointer?

609


Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

2616


What is the difference between char array and char pointer?

528


What is dynamic dispatch in c++?

563


write a program to concatenation the string using switch case?

1564