example of single dimension array

C, C++, etc Programing examples. Post as many you can. Test the programs and discuss about the output of the programes.
Forum rules
Please Discuss & post only about the programes and its Output

example of single dimension array

Postby kantisuthar » Sat Apr 16, 2011 3:01 pm

/*Print your name row wise and column wise*/
#include<stdio.h>
#include<conio.h>
void main()
{
char name[5];
int i;
clrscr();
printf("\n Enter Your name : " );
for(i=0;i<5;i++)
scanf("%c",&name[i]);
printf("\n Your name in row wise is : ");
for(i=0;i<5;i++)
printf("%c",name[i]);
printf("\n");
printf("\n Your name in coloumn wise is : ");
for(i=0;i<5;i++)
printf("\n%c\n",name[i]);
getch();
}
kantisuthar
Registered User
 
Posts: 6
Joined: Thu Apr 14, 2011 7:22 pm
membership: Associate Member of The Institution of Engineers (India)- AMIE

ad
 

Re: example of single dimension array

Postby ranjan » Wed May 04, 2011 9:22 pm

thks i lot for this post .
but there is a problem this is not compiling with visual studio .can you describe it with some example in reg of visual studio as i use it.
please treat me as a starter of c++ and i am very curious to know about it for exam point of view as well as personal understanding also.
User avatar
ranjan
Super Member
Super Member
 
Posts: 31
Joined: Sun Feb 27, 2011 7:24 pm
membership: Senior Technician of The Institution of Engineers (India)- ST


Return to Computer Notes : Some Sample Programs

Who is online

Users browsing this forum: No registered users and 0 guests