char=l;
string='hello';
This is my input,The particular character present in the string to change lower letter to upper letter.
Output: heLLo

Please anybody help me;

Recommended Answers

All 6 Replies

We don't do homework here. If you want help, you'll need to provide more than just program requirements.

commented: Indeed +17
#include<stdio.h>
#include<ctype.h>
void main()
{
 char str[20],a;      int i;
scanf("%s",str);
printf("Enter the char\n\t");
scanf("%c",a);
for(i=0;str[i]<=10;i++)
{
if(str[i]==a)
{
 printf("%c",toupper(str[i]));
 }
 else
 {
 printf("%c",str[i]);
 }
 }
 }

This is my code and i tried my possible ways of trouble shoot ot make it work; but i fails. I am getting an message stating "NULL POINTER ASSIGNMENT" :( ... please just trigger me the right way to get out of this issue..

Thanks in advance!

please just trigger me the right way to get out of this issue..

Look closely at your second call to scanf().

Thanks for your suggestion..Now i am not getting any error message. But still i am failing to get the output! i feel the code not event enter into the for loop. what i have done wrong ?

i got it where i made a mistake.. the problem was on for loop.. :) i fixed it... my last question. after my task done it also returns some junk value like some different symbols how to avoid it?

after my task done it also returns some junk value like some different symbols how to avoid it?

Don't know. We are unable to see your code as it is now, we don't know what your input was, we don't know what your output was.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.