C Program on String with Pointers

Get Certified in C Programming and Take Your Skills to the Next Level

Program 1

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
    char s[100],*p;
    int count=0,i;
    printf("Enter a String: ");
    gets(s);
    i=strlen(s);
    i--;
    p=&s[i];
   while(i>=0)
    {
       printf("%c",*p);
       i--;
       p--;
    }

    // while(*p!='\0')
    // {
    //      printf("%c",*p);
    //      if(*p=='a'||*p=='e'||*p=='i' ||*p=='o'||*p=='u')
    //        count++;
    //      if(*p=='A'||*p=='E'||*p=='I' ||*p=='O'||*p=='U')
    //        count++;  
    //      ++p;
    // }
    // printf("\n\nTotal Vowel %d ",count);
}

 

You give me 15 seconds I promise you best tutorials
Please share your happy experience on Google

courses

TechVidvan Team

TechVidvan Team provides high-quality content & courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.

Leave a Reply

Your email address will not be published. Required fields are marked *