C PGM
C PGM
C PGM
C */
# include <stdio.h>
# include <conio.h>
void main()
{
int mat[10][10] ;
int i, j, row, col ;
clrscr() ;
printf("Enter the order of the matrix : ") ;
scanf("%d %d", &row, &col) ;
printf("\nEnter the elements of the matrix : \n\n") ;
for(i = 0 ; i < row ; i++)
for(j = 0 ; j < col ; j++)
scanf("%d", &mat[i][j]) ;
printf("\nThe transpose matrix is : \n\n") ;
for(i = 0 ; i < col ; i++)
{
for(j = 0 ; j < row ; j++)
{
printf("%d \t", mat[j][i]) ;
}
printf("\n") ;
}
getch() ;
}
#include <stdio.h>
void main()
{
char *str;
char a[]="aeiouAEIOU";
int i,j,count=0;
clrscr();
printf("\nEnter the string\n");
gets(str);
for(i=0;str[i]!='\0';i++)
{
for(j=0;a[j]!='\0';j++)
if(a[j] == str[i]
{
count++;
break;
}
printf("\nNo. of vowels = %d",count);
getch();
}
}
# include <stdio.h>
# include <conio.h>
# include <string.h>
void main()
{
char str[10][20], temp[20] ;
int n, i, j ;
clrscr() ;
printf("Enter the number of strings : ") ;
scanf("%d", &n) ;
printf("\nEnter the strings : \n\n") ;
for(i = 0 ; i < n ; i++)
scanf("%s", str[i]) ;
for(i = 0 ; i < n - 1 ; i++)
for(j = 0 ; j < n - 1; j++)
if(strcmp(str[j], str[j + 1]) > 0)
{
strcpy(temp, str[j]) ;
strcpy(str[j], str[j + 1]) ;
strcpy(str[j + 1], temp) ;
}
printf("\nThe sorted order of strings are : \n\n") ;
for(i = 0 ; i < n ; i++)
printf("%s \n", str[i]) ;
getch() ;
}
#include <ctype.h>
#include <stdio.h>
int main(void)
{
char str[80];
int i;
return 0;
}