ANSWER : HERE IS THE ANSWER FOR YOUR QUESTION:
------------------------------------------------------------------------------------------------------
CODE:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char name[51], first[51]="", last[51]="";
printf("Enter full name:first name , a space and last name:
\n");
scanf("%s %s",&first,&last);
printf("First name: %s\n",first);
printf("Last name: %s",last);
return 0;
}
-------------------------------------------------------------------------------------------------------
SNIPPET
![main.c 1 2 3 #include <stdio.h> 4 #include <stdlib.h> 5 #include <string.h> 6 7 8 9 int main() 10- { 11 char name[51], first[](http://img.homeworklib.com/questions/ce933120-0b5d-11eb-9dd6-1f96452774c7.png?x-oss-process=image/resize,w_560)
---------------------------------------------------------------------------------------------------------
OUTPUT

EXPLANATION:
here , the scanf function is used to scanf the strings named as first and last
so , these varaibles will hold the values entered by the user as first name and last name .
now , in the print statement , we print the values of the first name and last name strings
-------------------------------------------------------------------------------------------------------
I hope this would help you out.
If you like my answer , please upvote
If you have any doubt, you can provide comment /feedback below the answer
Thanks
c/c++ Last name: First name: ID: Sec: The name, ID and section number that appear at...
c/c++
6 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 7 Note: results printed must show the data entered at run time, not the data shown in the sample run below! Sample run: My name: Smith, Peter My ID: 300999999 My section: 001 Enter your last name : Smith Enter your first name: Peter 8 9 10 11 12 13...
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...
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/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...
You must use C Language. The Main Objective: Make the first and last name ALL CAPITALS even if the user types in lower case letters. Lastly, flip the first name and last name around. So: HEIDI, HATFIELD to HATFIELD, HEIDI. (PLEASE uppercase all the letters) End Goal: HATFIELD, HEIDI KAISER, RUSSELL LIPSHUTZ, HOWARD PENKERT, DAWN WRIGHT, ELIZABETH Please use this reference below, to fix the code given. Code given is below, I want the user to be able to enter...
Given the following program: #include <stdio.h> struct student { int id; char name[20]; char grade; }; void func(struct student stud); int main() { struct student astud; astud.id=9401; strcpy(astud.name, "Joe"); astud.grade = 'A'; func(astud); return 0; } Abdelghani Bellaachia, CSCI 1121 Page: 16 void func(struct student astud) { printf(" Id is: %d \n", astud.id); printf(" Name is: %s \n", astud.name); printf(" Grade is: %c \n", astud.grade); } Modify this program to include the address of a student as a separate structure....
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...
this is c code. please answer all questions on a piece of paper and
show work. i need to prepare as i have a midterm i will have to be
completing on paper
1) Bit Operators: This C program compiles and runs. What is its output? 1) #include <stdio.h> 2) void main (void) 3) unsigned char x =60; 4) 5) 6) 7) 8 ) 9) 10) 11) 12) 13) unsigned char a = x < 1; unsigned char b unsigned...
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...