Number mirror Codechef problem Solution in C languages with logic
Receiving input from the user
In order to take input
from the user and assign it to a variable, we use scanf function.
The syntax for using scanf:
scanf("%d",&a);
// %d for integer
// %f for real constant
// %c for character
& is the “address
of” operator and it means that the supplied value should be copied to the
address which is indicated by variable i.
Here the code-->
#include <stdio.h>
int main(void) {
int n;
scanf("%d",&n);
printf("%d",n);
return 0;
}
The logic is very easy that first we declare a integer then take a input through user by using scanf then print that variable.
Thank You
Comments
Post a Comment
If you have any doubts let me know