Question

Convert this C program to Js (Java script) from Visual Studio Code #include<stdio.h> int main(){ char...

Convert this C program to Js (Java script) from Visual Studio Code

#include<stdio.h>
int main(){
  char firstName[100];
  char lastName[100];
  printf("Enter Your Full Name: \n");
  scanf("%s %s", firstName, lastName);
  printf("First Name: %s\n", firstName);
  printf("Last Name: %s\n", lastName);
  return 0;
}
0 0
Add a comment Improve this question Transcribed image text
Answer #1

var name = prompt("Enter Your Full Name: ");
var firstName = name.split(" ")[0];
var lastName = name.split(" ")[1];
document.write("First Name: " + firstName + "<br />");
document.write("Last Name: " + lastName + "<br />");

G First Name: John Last Name: Doe o Elements Console Sources » : O top Filter Defal 2 hidden > var firstName = prompt(Enter

Add a comment
Know the answer?
Add Answer to:
Convert this C program to Js (Java script) from Visual Studio Code #include<stdio.h> int main(){ char...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT