Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
array
//gcc 5.0.4 #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; #import <Foundation/Foundation.h> int i=0; NSArray *bvocstds = [NSArray arrayWithObjects:@"Dhara",@"Rupal", @"Krupali", @"Janavi", nil]; NSLog (@"Student Name= %@",[bvocstds objectAtIndex:1]); NSLog (@"Total Students =%d",[bvocstds count]); for (NSString *std in bvocstds) { NSLog (@"Student Name= %@", std); } NSLog (@"\n ----"); for(i=0;i<[bvocstds count];i++) { NSLog(@"Student Name= %@",[bvocstds objectAtIndex:i]); } if ([bvocstds containsObject:@"Jaydeep"]) { NSLog(@"bvocstds is Present"); } NSLog(@"Dhara's index is:%d",[bvocstds indexOfObject:@"Dhara"]); NSArray *todayspresent = [bvocstds subarrayWithRange:NSMakeRange(1, 2)]; for (NSString *std in todayspresent) { NSLog (@"Present Student Name= %@", std); } NSArray *todaysabsent = [bvocstds subarrayWithRange:NSMakeRange(3, 1)]; for (NSString *std in todaysabsent) { NSLog (@"Absent Student Name= %@", std); } NSArray *combineddata = [todayspresent arrayByAddingObjectsFromArray:todaysabsent]; for (NSString *std in combineddata) { NSLog (@"combineddatae= %@", std); } NSString *datastring = [bvocstds componentsJoinedByString:@", "]; NSLog (@"data= %@", datastring); [pool drain]; return 0; }
run
|
edit
|
history
|
help
0
primitive datatypes objective c
Interface implementation
basic arithmatic Opreation in objective C
Author1
enheritance
Sum Example
Objective C NSSet Declaration
Cylinder And Circle
Even numbers are at the beginning and all the Odd numbers
Program 2.1