No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I'm trying to determine then print the country of origin of a product based on its bar-code. I have isolated that part of the bar-code and stored it as countryCode, now what i am trying to do is determine its country then store the country name as a string so … |
|
[CODE=c]# include<stdio.h> # include<string.h> # include<stdlib.h> int main(int argc, char **argv){ // Declare Variables char barcode[50]; int count; long long intBarcode; long countryCode; int dig0, dig1, dig2, dig3, dig4, dig5; int dig6, dig7, dig8, dig9, dig10, dig11; long long num; long rem, sum; int checksum; long long manufac, product, language, … |
|
I am trying to take a user input phone number and perform calculations on it as an integer of type long long. I've tried this but it only reads the first 3 numbers then when it reaches the hyphen it stops. [CODE=C] printf("Enter Number: \n"); //get input from user count … |
|
[CODE]# include<stdio.h> # include<string.h> int main(int argc, char **argv){ char phone[16]; int num = 0; int count = 0; printf("Enter a phone number: "); count = scanf ( "%s%n", phone, num ); memmove(phone + 3, phone + 2, 10); memset(phone + 3, '-', 1); memmove(phone + 7, phone + 6, … |
|
[code = c][/code] I am trying to write a program that takes a 10 digit phone number and inserts hyphens between the 3rd and 4th digit and the 6th and 7th digit eg. Enter phone number: 5553459875 Your number is 555-345-9876 I've decided that reading the number as an integer … |