General discussion

Locked

arrays in c

By meeva ·
i am learning c programming language.

I have encountered a problem in which i cannot solve.

How do i display the following in ana array.

v[0] =M, v[1] = w v[2]=a

after i display tis how do i stack R into the array and display the characters and array number please help really stressful

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by hi_min2 In reply to arrays in c

hope the following code may help you:-
main()
{
char a[]={'w','w','a'};
int i,n,x;
clrscr();
x=sizeof(a);
for(i=0;i<x;i++)
printf("a[%d]=%c\n",i,a);
printf("enter the next element");
scanf("%c",&a[x]);
x=x+1;
for(i=0;i<x;i++)
printf("a[%d]=%c\n",i,a);
getch();

}

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums