Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Write a C program to input your full forename and full surname. e.g James McCarren and display in one string your complete initial and surname i.e J McCarren . Your initial should always be in upper case.
We could use pointers or char arrays let us do both Answer: pointers #include #include /* malloc's prototype is in stdlib.h */ #include /* toupper's prototype is in ctype.h */ #include void main() { char prompt; Date: 26th August 2012 Version 1.0 Function : Example to show string manipulation Modifications: none*/ char *text,*forename,*surname; /* We must allocate space for the strings say 80 chars so we use 81 because the terminator takes 1 space*/ text = (char *)malloc(81); forename = (char *)malloc(81); surname = (char *)malloc(81); if ((text == NULL)|| (forename == NULL) || (surname== NULL)) { printf("Memory full Error type -1 \n\r"); exit(1); } printf("Please enter in your fore and surname name\n\r"); /* Note no address operator required because text is an address Scanf will read up to a white space and assign that to forename the rest will be assigned to surname*/ scanf("%s%s",forename,surname); /* We can extract the initial of the forename and store in in temp*/ *text = toupper(*forename); *(text+1) = ' '; *(text+2) = '\0'; /*We can now add together the two strings */ strcat(text,surname); printf("Hello %s\n\r",text); printf("Press and key to exit \n\r"); scanf("\n%c",&prompt); }
Using Figure 10.2 as a model, illustrate the result of each operation in the sequence ENQUEUE.Q; 4/, ENQUEUE.Q; 1/, ENQUEUE.Q; 3/, DEQUEUE.Q/, ENQUEUE.Q; 8/, and DEQUEUE.Q/ on an i
Project Description: I'm seeking someone who could write me a torrent seeding client which supports multiple proxies. The goal of the project is to make torrents popular by seed
Pawnbroker software to be written in VB Project Description: I want software written for my pawnshop. I am currently using a program called pawnboss but would like to have my
Using the Constructor There are basically three ways of creating and initializing the object. The first way to call the constructor is explicitly as :
In this problem you are given a board in which some of the elements are placed as shown in diagram below. Each element represents a color. Fill the other elements in the board, suc
(a) client server or multithreaded client-server, where server will create pool of worker threads (say 5) to provide services to pool of clients (say 5 ).Server should be behaving
There are 25 employees in a business. Each employee has 5 sales each day of the month (Assume there are 30 days in each month of the year). Draw a flowchart for a pr
wap to count the numof string present in a word
In which condition a template a better solution than a base class? A: While you are designing a generic class to contain or manage objects of other types, while the format & beh
Project Description: I want a person who will be able to program a flex PCB for my device as i meet the person i will be able to describe all my needs Skills required are C P
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd