You are on page 1of 1

#include<iostream>

using namespace std;


main()
{
char name[]="Ali";
char lastname[]="Raza";
char VUID[]="MC210400207";

int lastdigit=0;

int vowels = 0;

cout<<"My name is Ali"<<name<<endl;


cout<<"My VUID is : "<<VUID<<endl;
cout<<"Last digit of my VUID is :"<<lastdigit<<endl;

for(int i=0;name[i]!='\0';i++)
{
if(name[i] =='a' || name[i] =='e' || name[i] =='i' ||
name[i] =='o' || name[i] =='u' || name[i] =='A' ||
name[i] =='E' || name[i] =='I' || name[i] =='O' ||
name['U'] )
{
vowels++;
cout<<"Vowels No"<<vowels<<":"<<name[i]<<endl;
}
}
int total = vowels + lastdigit;
cout<<"\nTotal Vowels in my first name :"<<vowels<<endl;
cout<<"Sum of vowels in my name and VUID is :"<<total<<endl;

if(total %2==0)
for(int i=1;i<=total;i++)
{
cout<<"\nIteration no :"<<i<<endl;
cout<<"My first name is "<<name<<endl;
}
else
{

for(int i=1;i<=total;i++)
cout<<"\nIteration no :"<<i<<endl;
cout<<"My last name is "<<lastname<<endl;
}
return 0;
}

You might also like