can please someone help me finding the error in my code. their are no syntax error. but somewhere it is wrong since i am not getting my desired output. the functions gets() and toupper() are not getting implemented from the library.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int toupper(char d);
char gets(char a[100]);
int main(void)
{
int i;
char a[100];
printf("enter your name \n");
gets(a);
printf("%c",toupper(a[0]));
for(i=1;a[i]!='\0';i++)
{
if(a[i]==' ')
{
printf("%c",toupper(a[i+1]));
}
}
printf("\n");
return 0;
}
int toupper(char d)
{
return (d-32);
}
char gets(char a[100])
{
int i;
for(i=0;a[i] != '\0'+1;i++)
{
scanf("%c",&a[i]);
}
return a[i];
}