License, disclaimer of liability, and limited warranty



Download 2,08 Mb.
Pdf ko'rish
bet152/393
Sana05.01.2022
Hajmi2,08 Mb.
#319699
1   ...   148   149   150   151   152   153   154   155   ...   393
Bog'liq
C Programming A Self Teaching Int 1uq45XL

OUTPUT (after running):
Enter the number of rows


4
1
 
 
 
2
3
 
 
 
4
5
6
 
 
7
8
9
10
].
Q15.
Write a C program to generate a sequence of numbers using a for loop construct and print them
in the following format:
1
 
 
 
 
2
3
 
 
 
4
5
6
 
 
7
8
9
10
 
11
12
13
14
15 ?
[Hint:
           void main( ) {
                int k=1;
                printf(“%d”, k);
                for(int i=1;i<5;i++) {
                      printf(“%d”, ++k);
                      for (int j=0; j                            k+=1;
                            printf(“%d”, k);
                       }
                      printf(“\n”);
                 }
             }
           }
OUTPUT (after running):
1
 
 
 
 
2
3
4
5
6
7
8
9
10
11
12
13
14
15 ].
Other Statements of C
The break Statement


When a break statement is executed inside a loop, it skips the remaining statements of that loop and
control is immediately transferred outside the loop.
Syntax
break;
For example,
         void main( )
          {
            int i, j;
            for(i=1; i<=3;i++)
             {
                  for(j=1;j<=3;j++)
                   {
                        if(i= =j)
                              break;
                        else
                              printf(“%d\t %d”, i, j);
                   }
             }
            }
          }

Download 2,08 Mb.

Do'stlaringiz bilan baham:
1   ...   148   149   150   151   152   153   154   155   ...   393




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish