array2d_2 - ComputerProgrammingITAC162. Todays Agenda...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Computer Programming I TA C162 . 03 Apr 2007 Today’s Agenda 2-D Dimensional Arrays
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Computer Programming I TA C162 . 03 Apr 2007 Arrays of Strings Declaration:   char name[5][30]; Five strings each contains maximum thirty characters. Initialization: char[5][10]={“One”,”Two”,”Three”,”Four”,”Five”}; Other valid declarations char[][]={“One”,”Two”,”Three”,”Four”,”Five”}; char[5][]={“One”,”Two”,”Three”,”Four”,”Five”};
Background image of page 2
3 Computer Programming I TA C162 . 03 Apr 2007 String Arrays: Reading and Displaying void main() { char name[5][30]; printf(“\n Enter five strings”); /* Reading strings */ for(i=0;i<5; i++) scanf(“%s”,name[i]); /* Printing strings */ for(i=0;i<5; i++) printf(“\n%s”,name[i]); }
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Computer Programming I TA C162 . 03 Apr 2007 Problem 1: Array of Strings Problem Statement:   Write a C program that reads names of students and sort them in dictionary order.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/14/2010 for the course CS SS ZG653 taught by Professor Shanta during the Spring '09 term at Birla Institute of Technology & Science.

Page1 / 10

array2d_2 - ComputerProgrammingITAC162. Todays Agenda...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online