A shorthand array notation in C for repeated values Last Updated : 18 Sep, 2017 Comments Improve Suggest changes 24 Likes Like Report In C, when there are many repeated values, we can use a shorthand array notation to define array. Below program demonstrates same. C // C program to demonstrate working of shorthand // array rotation. #include <stdio.h> int main() { // This line is same as // int array[10] = {1, 1, 1, 1, 0, 0, 2, 2, 2, 2}; int array[10] = {[0 ... 3]1, [6 ... 9]2}; for (int i = 0; i < 10; i++) printf("%d ", array[i]); return 0; } Output: 1 1 1 1 0 0 2 2 2 2 Note that middle gap of 2 is automatically filled with 0. Create Quiz Comment K Kaushik Annangi 24 Improve K Kaushik Annangi 24 Improve Article Tags : Misc C Language c-array Explore C BasicsC Language Introduction6 min readIdentifiers in C3 min readKeywords in C2 min readVariables in C4 min readData Types in C3 min readOperators in C8 min readDecision Making in C (if , if..else, Nested if, if-else-if )7 min readLoops in C6 min readFunctions in C5 min readArrays & StringsArrays in C4 min readStrings in C5 min readPointers and StructuresPointers in C7 min readFunction Pointer in C6 min readUnions in C3 min readEnumeration (or enum) in C5 min readStructure Member Alignment, Padding and Data Packing8 min readMemory ManagementMemory Layout of C Programs5 min readDynamic Memory Allocation in C7 min readWhat is Memory Leak? How can we avoid?2 min readFile & Error HandlingFile Handling in C11 min readRead/Write Structure From/to a File in C3 min readError Handling in C8 min readUsing goto for Exception Handling in C4 min readError Handling During File Operations in C5 min readAdvanced ConceptsVariadic Functions in C5 min readSignals in C language5 min readSocket Programming in C8 min read_Generics Keyword in C3 min readMultithreading in C9 min read Like