| | |
void function
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Oct 2006
Posts: 164
Reputation:
Solved Threads: 3
Hey. Seems like you've made some progress. Thanks great! Below is my solution but as noted previously, there are many. Hope it helps!
C++ Syntax (Toggle Plain Text)
/** * @file printV.c * @description Prints a V shape. **/ #include <stdio.h> void printV(int); int main() { printV(4); // Change # to change the number of rows. } void printV(int numRows) { int i,j; int cols = (numRows * 2) - 1; char vChar = '#'; char emptyChar = ' '; for(i=1; i <= numRows; i++) { for(j=1; j <= cols; j++) { if(i==j || i+j == numRows*2) printf("%c", vChar); else printf("%c", emptyChar); } printf("\n"); } }
![]() |
Similar Threads
- Conversion error passing Vector as a pointer to void function... (C++)
- Weird error by a void function (C++)
- Void function does not return the value (C++)
- Question on non-void function (C++)
- void function (C++)
Other Threads in the C++ Forum
- Previous Thread: [HELP]Adding string between text.
- Next Thread: glut still not working... much
| Thread Tools | Search this Thread |
api array arrays based binary bitmap c++ c/c++ calculator char char* class classes code coding compile console conversion convert count data database delete deploy developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game generator getline givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





