By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,302 Members | 1,427 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,302 IT Pros & Developers. It's quick & easy.

print using for loops

P: 5
1
22
333
4444
55555......
Feb 18 '07 #1
Share this Question
Share on Google+
2 Replies


Ganon11
Expert 2.5K+
P: 3,652
Did you have a question?
Feb 18 '07 #2

cyberking
P: 84
1
22
333
4444
55555......
Hi..

This is not a good idea to come and ask us to do your assignments.
However, here goes the code.

Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2.  
  3. void main()
  4. {
  5.   int i,n;
  6.   printf("Please enter the number");
  7.   scanf("%d",n) ;
  8.  
  9.  
  10.  for( a=1;a<n;a++)
  11.  {
  12.  
  13.     for(j=1;j==a;j++)
  14.     {
  15.  
  16.  
  17.       label: printf("%d", a);   
  18.  
  19.        if(j==a)
  20.        printf("\n");
  21.        else
  22.        goto label;
  23.  
  24.        j++;
  25.     }
  26.  
  27.       a++;
  28.  
  29.  }
Feb 18 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.