I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component public class AllViewComponent : ViewComponent { private readonly UserManager<ApplicationUser> _userManager; public AllViewComponent(UserManager<ApplicationUser> userManager) { _userManager = userManager; } public async Task<IViewComponentResult> InvokeAsync() { List<StudentViewModel> allUsers = new List<StudentViewModel>(); var items = await _userManager.Users.ToListAsync(); foreach (var item in items) { allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email }); }
C program to sort 10 elements of an array and a list of 11 names in ascending order using selection sort technique
C program to sort 10 elements of an array in ascending order using selection sort technique.
#include<stdio.h>#include<conio.h>
void se1_sort_ao(int arr[],int n)
{
int i, j, min, mops;
for(i=0;i<n-1;i++)
{
min = arr[i]; mpos = 1;
for(j=i+1; j<n; j++)
if(arr[j] < min)
{
min = arr[j]; mops = j;
}
arr[mpos] = arr[i]; arr[i] = min;
}
}
main()
{
int a[10], i;
printf("Enter 10 element of the array:\n \n");
for(i=0;i<10;i++)
scanf("%d",&a[i]);
printf("The array before sorting:\n \n");
for(i=0;i<10;i++)
printf("%d",a[i]);
sel_sort_ao(a,10);
printf("\n \n The array after sorting:\n \n");
for(i=0;i<10;i++)
printf("%d",a[i]);
}
C program to sort a list of 11 names in ascending order using selection sort technique.
#include<stdio.h>
#include<conio.h>
#include<string.h>
void se1sortstrao(char a[][20],int n)
{
int i, j, mops, k; char min[20];
for(i=0;i<n-1;i++)
{
strcpy( min,a[i]); mpos=i;
for(j=i+1; j<n; j++)
if(strcmp(a[j],min)<0)
{
strcpy(min,a[j]); mpos=j;
}
strcpy(a[mpos],a[i]); strcpy(a[i],min);
}
}
main()
{
char a[11][20];
int i;
clrscr();
printf("Enter List of 11 names:\n \n");
for(i=0;i<11;i++)
gets(a[i]);
selsortstrao(a,11);
clrscr();
printf("The List after sorting:\n \n");
for(i=0;i<11;i++)
puts(a[i]);
}
Comments
Post a Comment