String and struct

using System;
using System.Collections.Generic;

namespace ConsoleApp2
{


class Program
{
struct Student
{
public String name;
public int age;


};


static void Main(string[] args)
{

Student student = new Student();
student.name = "Sabir";
student.age = 13;

Console.WriteLine("Name=" + student.name + " Age=" + student.age);
String str = @"Compuuter\";
string str2 = "computer";

var num1 = 10;
var s = "abc";
int count = 0;
for(int i=0;i<str.Length;i++)
{
if(str[i]=='a'||str[i]=='e'|| str[i] == 'i'|| str[i] == 'o'|| str[i] == 'u')
{
count++;
}
}

Console.WriteLine("Total vowls=" + count);


}
}
}

Comments

Popular posts from this blog

Method Function

Record