63 193
Assignments Done
99,3%
Successfully Done
In July 2018

Answer to Question #16508 in C++ for Ashish

Question #16508
write a c program to ask the users to enter their first and last name and print the name and number of character in it.
Expert's answer
#include "stdafx.h"

#include <stdio.h>

using namespace std;

#define MAXNUM 100

int main()

{

char message [MAXNUM];

int numchar;

printf("Type in a your name: ");

gets(message);

for (int i = 0; i < MAXNUM; i++){

if (message[i] != ' '){

numchar++;

}

}

printf ("The number of characters entered is %d
", numchar);

return 0;

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions