Skip to content

Instantly share code, notes, and snippets.

@raydvard
Created September 9, 2014 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raydvard/0c7cd38c45e6ef4f01e7 to your computer and use it in GitHub Desktop.
Save raydvard/0c7cd38c45e6ef4f01e7 to your computer and use it in GitHub Desktop.
C++ Practice kortesi :)
//###################### Prac-1 ########################## //
// Input an integer number and output the last digit of the given number //
// ####################################################### //
#include <stdio.h>
int main()
{
int num, ld;
printf("Please input an integer number: ");
scanf("%d", &num);
ld = num % 10; // Logic to output last digit of any integer number is to find out the reminder !!
printf("\nThe last digit of the given number is: %d", ld);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment