Satrdagi katta harflar sonini topadigan dastur tuzing


Download 52.88 Kb.
Sana28.12.2022
Hajmi52.88 Kb.
#1015465
Bog'liq
Muhammadaslxon dasturlash topshiriq (2)


Muhammad Al-Xorazmiy nomidagi


Toshkent Axborot Texnologiyalari Universiteti
120-22-guruh talabasi Nig`matxonov Muhammadaslxonning
Dasturlash I fanidan bajargan amaliy topshirig`i

Bajardi: M.Nig`matxonov

Tekshirdi: D.R.Gulyamova

1-jadval


13.

Satrdagi katta harflar sonini topadigan dastur tuzing.

Dastur kodi:
#include
#include
#include
using namespace std;
int main()
{
int i;
int upper=0,lower=0;
char ch[100];
cout<<"So`zlarni kiriting:\n";
gets(ch);
for(i=0; ch[i]!=0; i++){
if(ch[i]>='A' && ch[i]<='Z'){
upper++;
}
}

cout<<"\nKatta harflar: "<
getch();
return 0;}
Dastur natijas:

2-topshiriq


13.

char turidagi A satrdagi har bir verguldan oldin, B satrdagi oʻzlarni joylashtirish natijasida S satrini hosil qiluvchi dastur tuzing.

#include


#include
using namespace std;

int main()


{ char A[256],B[256];
int n;string S;
cout<<"satr kiriting:";cin>>A;
cout<<"satr kiriting:";cin>>B;
n=strlen(A);
for (int i=n;i>=0;i--){
if (A[i]==',')
S=S+B[i];
else
S=S+A[i];
} cout<return 0;
}
Dastur natijasi:

Download 52.88 Kb.

Do'stlaringiz bilan baham:




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