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

Write a C program linear.c that creates a sequence of processes with a given length. By sequence it is meant that each created process has exactly one child. Let's look at some example outputs for the program. Here the entire process sequence consists of process 18181: Sara@dell:~/OSSS$ ./linear 1 Creating process sequence of length 1. 18181 begins the sequence. An example for a sequence of length three: Sara@dell:~/OSSS$ ./linear 3 Creating process sequence of length 3. 18233 begins the sequence. 18234 is child of 18233 18235 is child of 18234 ........ this is coad .... BUt i could not compleate it .....:( #include <stdio.h> #include <sys/types.h> #include <unistd.h> #include <stdlib.h> int main(int argc, char *argv[]) { int N; pid_t pid; int cont; if (argc != 2) { printf("Wrong number of command-line parameters!\n"); return 1; } N = atoi(argv[1]); printf("Creating process sequence of length %d.\n",N); printf("%d begins the sequence.\n",getpid()); /* What I have to do next ?????? */ }

0 Answers  


Is c is a procedural language?

0 Answers  


GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)

0 Answers  


how to connect oracle in C/C++.

3 Answers   TCS, Wipro,


Function calling procedures? and their differences? Why should one go for Call by Reference?

0 Answers   ADP,






What are the valid places to have keyword “break”?

0 Answers  


Explain what happens if you free a pointer twice?

0 Answers  


which of the function operator cannot be over loaded a) <= b)?: c)== d)*

10 Answers   Cisco, CTS, Google, HCL, HP,


‎How to define structures? · ‎

0 Answers  


How can I get Single byte from 'int' type variable? Can we alter single bit or multiple bits in int type variable? if so, How?

2 Answers  


what is different between auto and local static? why should we use local static?

0 Answers  


a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

0 Answers   Mindteck,


Categories