Vote count:
0
I am taking an online course and working on a project for it. But i have a problem I need to know how to take one number from a larger number and the I'm trying to take it from is one that is user input her is part of it I want to know how to take the number the user input on line 7 and take single numbers out my goal is to take every other number then add them add multiply them by two then take the other numbers not used and add those to them. If any one could help that would be great.
#include <stdio.h>
#include <cs50.h>
int main(void)
{
printf("Please type your credit card number: ");
long long CardNumber = GetLongLong();
if(CardNumber < 999999999999 || CardNumber > 99999999999999999)
{
printf("Invald Card Number\n");
}
else if(CardNumber > 999999999999 && CardNumber < 99999999999999) {
printf("Visa: %lld Vaild Number\n", CardNumber);
}
else if(CardNumber > 99999999999999 && CardNumber < 999999999999999) {
printf("American Express Or Visa: %lld Vaild Number\n", CardNumber);
}
else if(CardNumber > 999999999999999 && CardNumber < 9999999999999999) {
printf("MasterCard Or Visa: %lld Vaild Number\n", CardNumber);
}
else{
printf("Card Number Vaild: %lld \n", CardNumber);
asked 41 secs ago
How do I extract a single letter or number from a string or number?
Aucun commentaire:
Enregistrer un commentaire