Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* C pattern program */
- /*
- +
- +-
- +-+
- +-+-
- +-+-+
- */
- #include <stdio.h>
- int main()
- {
- int i,j;
- for(i=1;i<=5;i++)
- {
- for(j=1;j<=i;j++)
- {
- if(j%2==1)
- {
- printf("+");
- }
- else
- {
- printf("-");
- }
- }
- printf("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment