when I write this code in c it does not work but when I make few changes like replacing with cin and cout it works fine in c++
#include <stdio.h>
    #include <string.h>
    int main()
    {
        int i=0,l,m;
        char str[10],c;
        printf("Enter string:");
        scanf("%s",str);
        printf("Enter character u want to search:");
        scanf("%s",c);
        l=strlen(str);
        while (str[i]){
            if (str[i]==c){
                m=1;
                break;
            }
            else{
                m=0;
            }
            i++;
        }
        if (m==1){
            printf("Present \n");
        }
        else{
            printf("Not present \n");
        }
    }
 
     
     
    