// C Code:-
#include <stdio.h>
#include<stdlib.h>
#include<string.h>
void main()
{
char last[31],first[31];
char fullname[61];
char id[10],sec[10];
// User input the last name ,first name ,id and
section.
printf("Enter your last name : ");
scanf("%s",last);
printf("Enter your first name : ");
scanf("%s",first);
printf("Enter your Id : ");
scanf("%s",id);
printf("Enter your Section : ");
scanf("%s",sec);
// Store first name and last name in full
name.
strcpy(fullname,first);
strcat(fullname," ");
strcat(fullname,last);
// printing the detail in the desired
format.
printf("*********************************************************************\n");
printf("My name: %s, %s My ID: %s My section:
%s\n",last,first,id,sec);
printf("*********************************************************************\n\n");
printf("My full name is %s\n",fullname);
}
![main.c 1 #include <stdio.h> 2 #include<stdlib.h> 3 #include<string.h> 4 5 void main() 6{ 7 char last[31],first[31]; 8 char fu](http://img.homeworklib.com/questions/e71579c0-0bdd-11eb-8951-cb0e906e64a8.png?x-oss-process=image/resize,w_560)
Output:

c/c++ 6 The name, ID and section number that appear at the beginning of the output...
c/c++
Last name: First name: ID: Sec: The name, ID and section number that appear at the beginning of the output of the program should be your own, not the ones used in the sample Note: results printed must show the data entered at run time, not the data shown in the sample run below! Sample run: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24...
c/c++
6 Using some of the library string handling functions Here, you are to read first and last names of a person and join the two into a full nmae. But you will have to check that the string full name has a 'room' for all these characters. In this problem, the maximum number of characters in the full name is 20 Initially allow a maximum number of 15 characters of first & last names (One name length may compensate...
c/c++
Passing arrays as arguments to functions. The main() is given, write the function 'average' (Study the syntax of passing an array as a function parameter) The program prompts the user to first enter the number of tests given in a course, and then prompts him/her to enter the mark for each test. The marks are stored in an array. This takes place in the main() function. It then passes the array to a function named 'average' that calculates and...
I'm having trouble getting my program to output What is your first name? damion what is your last name? anderson damion, Your first name is 6 characters Your last name, anderson, is 8 characters Your name in reverse is: noimad nosredna This is my code so far: #include <stdlib.h> #include <stdio.h> void sizeOfName(char** name); void printSizeOfName(int *first, int *last, char** name); void reverseString(int *first, int *last, char** name); int main() { char** name; name = (char**)malloc(2*sizeof(char*)); name[0] = (char*)malloc(100*sizeof(char)); name[1]...
C program help #include #include #include void PrintName(char firstname[16], char lastname[16]); int main () { char firstname[16]; char lastname[16]; printf("please enter your first name:"); scanf("%s",firstname); printf("please enter your last name:"); scanf("%s",lastname); PrintName(firstname,lastname); return 0; } void PrintName(char firstname[16], char lastname[16]){ char fullname[34]; *fullname=*firstname+*lastname; (char*) malloc (sizeof (*fullname)); if (strlen(firstname) > 16||strlen(lastname)>16||strlen(fullname)>16) fflush(stdin); else printf(" the full name is %s %s \n",firstname,lastname); printf(" the full name is-> %s",fullname);/*why is one not run*/ return 0; }
c/c++
This is a simple debugging question. The program (as written) tries to add up the elements of two arrays and store the results into a third array. The idea is that every element of the third array equals the sum of the two corresponding (i.e same index or position in the array) elements in the first two arrays. There is a syntax error, because the way it is written is not the correct way to do it. You are...
c program Your teacher want to find out who is the most hardworking student in class! They want to input the names according to the order they fell asleep, then print their names in the reverse order. Although you can create an array large enough to store all names, your teacher don’t want to waste our precious memory! The first line of the input is an integer x, which indicate the number of students in class. Then there are x...
If x wame_Test_%232_2020W.pdf 2. Fill in the proper type specifiers in the two printf() statements in the C program shown below. Save your completed file as <YourName>_Test2_2.cpp. (5 Marks] When you are finished, copy all of the source code into this Word document (replacing the code below). Make sure the formatting from Visual Studio is preserved. Question 2: Code Replace this code with your source code. *** Test #2, Question #2, ETEC128 #include <stdio.h> #include <stdlib.h> int main(void) //********** Enter...
Implement a program that: reads a number of personal records (for example, using PERSON struct from the earlier lab) from the standard input, creates a database of personal records, allows for adding new entries to the database, allows for deleting entries from the database, includes functions to acquire a record of personal data, and includes functions to display (print) a single selected record from the database, and also allows for printing all records in the database. NOTES: if name is...
This is for a C++ program: I'm almost done with this program, I just need to implement a bool function that will ask the user if they want to repeat the read_course function. I can't seem to get it right, the instructions suggest a do.. while loop in the main function. here is my code #include <iostream> #include <cstring> #include <cctype> using namespace std; const int SIZE = 100; void read_name(char first[], char last[]); void read_course(int & crn, char des[],...