Computer Science, asked by crystal2189, 19 days ago

Write a c program to print your class students name using looping statement?

Answers

Answered by CrazyKanav
0

Answer:

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

printf("name: %s\n", names[i]);

#include <stdio.h>

int main() {

char names[2][50] = {

"Ram",

"Shyam"

}

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

printf("name: %s\n", names[i]);

}

Explanation:

Char names creates a list of names. [2] is how many strings there is and [50] is the max length of a string in characters or bytes.

for loop prints all the names in the loop. Thanks.

Array of strings : https://overiq.com/c-programming-101/array-of-strings-in-c/

For loop: https://www.programiz.com/c-programming/c-for-loop

Similar questions