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.
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 |
How do you generate random numbers in C?
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
where do we use structure pointer?
What is the g value paradox?
What are the data types present in c?
What is time null in c?
What is the use of header?
How can I allocate arrays or structures bigger than 64K?
Differentiate abs() function from fabs() function.
Write a program that his output 1 12 123
write a program for even numbers?
Write a function that accepts two numbers,say a and b and makes bth bit of a to 0.No other bits of a should get changed.
2 Answers Scientific Atlanta, Wipro,