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); }
Project Description: My project is about telephone billing system. This project was my project in my college life. The project is quite easy, i needed C++ programming language..
Program for Memory Optimization of C / OpenCL Code Project Description: This is possibly a very simple project for someone with an excellent knowledge of C and OpenCL. That,
A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string of the c
Explain zero based addressing. - Array subscripts always start at zero. - These subscript values are used to identify elements in the array. - As subscripts start at 0, a
A: Along with the C++ language, you can overload operators and functions. Overloading is the practice of supplying more than one definition for a provided function name in the same
Project Description: Need someone to prepare a trading platform and sophisticated trading strategy. Must have knowledge and experience in most of these: QuickFIX, Esper, Quan
Description: Create a program that allows the user to track the hours an employee worked in a week. How much the employee was paid and any extra hours worked (overtime pay).
Question : (a) How does a structure differ from an array? (b) Describe how a structure differs from a union? (c) Declare a union called ‘clothes' which consists of the
Ask4. Write a query to display the columns listed below. The query should list each customer in which the video rental is overdue. The Days_Overdue column should calculate the numb
Operation on String - C ++ Program: Write a program to define operations on string in c++. class String { char *char_ptr; // pointer to string contents int le
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: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd