Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

computer programming of array,character and strings

1 Ansicht (letzte 30 Tage)
LAU CHEE WOOI
LAU CHEE WOOI am 25 Nov. 2015
Geschlossen: Walter Roberson am 25 Nov. 2015
1. Assume that variables c (which stores a character), x, y and z are of type int, variables d, e and f are of type double and arrays string1[100] and string2[100] are of type char. Write the program below.
Write a single statement to accomplish each of the following.
(a) Assign alphabet G to c.
(b) Print the value of variable c. Do not use printf.
(c) Read a line of text into array string1 from the keyboard. Do not use scanf.
(d) Print the line of text stored in array string1. Do not use printf.
(e) Assign string “Malaysia” to array string2.
(f) Determine the length of the string in string1. Print the result.
(g) Convert the string "8.63582" to double and assign it to d.
(h) Copy the string stored in array string1 into array string2.
(i) Append 5 characters from the string in string2 to the string in string1.
  2 Kommentare
Thorsten
Thorsten am 25 Nov. 2015
This is homework. What have you tried so far?
James Tursa
James Tursa am 25 Nov. 2015
Is this MATLAB or C?

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by