You are on page 1of 5

Zanser Andrei

#include<stdio.h>
#include<string.h>
int main()
{
char num[100];
printf("Numele dvs este:");
gets(num);
printf("Salut, %s!\n", num);
return 0;
}
#include <stdio.h>
#include <string.h>
int main()
{
char text[100];
int i,n=0;
printf("Introduceti un text:");
gets(text);
for(i=0;i<strlen(text);i++){
if (text[i]=='a') {
n++;
}}
printf("Litera a se intalneste de %d ori",n);
return 0;
}

#include <stdio.h>
int main()
{
int i=0, n=0;
char text[1000];
printf("Introduceti un text:\n");
gets(text);
while (text[i] != '\0') {
if (text[i] == 'a' || text[i] == 'A' || text[i] == 'e' || text[i] == 'E' || text[i] == 'i'
|| text[i] == 'I' || text[i] =='o' || text[i]=='O' || text[i] == 'u' || text[i] == 'U')
n++;
i++;
}
printf("Numarul vocalelor din text sunt: %d", n);
return 0; }

#include<stdio.h>
#include<string.h>
int main ()
{
char text[1000];
int i,n,c=0;
printf("Scrieti un cuvant:");
gets(text);
n=strlen(text);
for(i=0;i<n/2;i++) {
if (text[i]==text[n-i-1])
c++;
} if(c==i)
printf("Acest cuvant este un palindrom");
else
printf("Acest cuvant nu este un palindrom");
return 0; }

#include <stdio.h>
#include <string.h>
int main(){
char text[100];
int i, n=0;
printf("Introduceti un text:\n");
gets(text);
for(i=0;i<strlen(text);i++) {
if (text[i]=='o' && text[i+1]=='a')
n++;
} printf("oa de %d ori\n",n);
return 0;}

You might also like