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

main() { char *p; p="Hello"; printf("%c\n",*&*p); }

2 Answers   ME,


Can we increase size of array in c?

0 Answers  


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

0 Answers  


write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

0 Answers  


What is the use of a ‘’ character?

0 Answers  


1 1 1 1 2 1 1 3 3 1 1 4 6 4 1

1 Answers  


what is the use of using linked list and array?

10 Answers   Infosys, TCS,


Difference between null pointer and dangling pointer?

7 Answers   GE, Wipro,


What is array in c with example?

0 Answers  


What is a union?

0 Answers  


What is the difference between the expression “++a” and “a++”?

0 Answers  


#&#8206;include&#8236;<stdio.h> void main() { int i; for(i=5;0;i++) { printf("%d",i); } }

2 Answers   Facebook,


Categories