Read N characters in to an array . Use functions to do all
problems and pass the address of array to function.

1. Print only the alphabets . If in upper case print in
lower case vice versa.



Read N characters in to an array . Use functions to do all problems and pass the address of array ..

Answer / vignesh1988i

#include<stdio.h>
#include<conio.h>
void fun(char *);
void main()
{
char a[50];
printf("enter the characters :");
gets(a);
fun(&a);
getch();
}
void fun(char *a)
{
char c;
for(int i=0;a[i]!='\0';i++)
{
if(a[i]>=97&&a[i]<=122)
{
c=a[i]-32;
printf("%c",c);
}
else if(a[i]>=65&&a[i]<=90)
{
c=a[i]+32;
printf("%c",c);
}
else if(a[i]==' ')
countine;
}
}

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More C Interview Questions

Where are local variables stored in c?

0 Answers  


what is a constant pointer in C

0 Answers  


Explain Linker and Loader

5 Answers  


What are the differences between Structures and Arrays?

0 Answers   TCS,


Ca some one please help me with aC code to allow user enter numbers from 1 to 20 without repeating and prnt the sum of those numbers thnx

4 Answers  






what is the most appropriate way to write a multi-statement macro?

1 Answers  


What is || operator and how does it function in a program?

0 Answers  


What is the difference between memcpy and memmove?

0 Answers  


What is a static function in c?

0 Answers  


what's the o/p int main(int n, char *argv[]) { char *s= *++argv; puts(s); exit(0); }

1 Answers   Motorola,


How can I read/write structures from/to data files?

0 Answers  


What does do in c?

0 Answers  


Categories