Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main ( void )
- {
- int total = 0, i;
- int array [ 4 ] = {4,3,7,5,2};
- int input [ 5 ] = {0};
- scanf ( "%d%d%d%d%d", input );
- for ( i = 0; i < 5; i++ ) {
- total += array [ i ] * input [ i ]; }
- total % 10;
- if ( total == array [ 5 ] )
- printf ( "%d%d%d%d%d is correct", input [ 5 ] );
- else
- printf ( "%d%d%d%d%d has an error", input [ 5 ] );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement