Write a c program using for loop to print typical pattern if
number of rows is entered by keyboard.
ABCBA
AB BA
A A
Answer / a.jayashree
#include<stdio.h>
#include<string.h>
main()
{
char a[5];
int i=0,j=0;
printf("enter the string");
scanf("%s",a);
printf("\n%s",a);
for(i=0;i<a[5];i++)
{
if(a[i]==a[2])
{
printf("\n\t");
}
else
{
printf("%s",a);
}
}
for(j=0;j<a[5];j++)
{
if(a[j]==a[1])
{
if(a[j]==a[2])
{
if(a[j]==a[3])
{
printf("\n\t\t\t");
}
else
{
printf("%s",a);
}
}
}
}
}
| Is This Answer Correct ? | 2 Yes | 6 No |
Write the following function in C. stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.
what is a c-language.what is do.
write a program that eliminates the value of mathematical constant e by using the formula e=1+1/1!+1/2!+1/3!+
Explain what are the different file extensions involved when programming in c?
how to TOGGLE Nth bit of variable in a MACRO
Program to find the value of e raised to power x using while loop
What Is The Difference Between Null And Void Pointer?
what are non standard function in c
What is the difference between variable declaration and variable definition in c?
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
What is volatile, register definition in C
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures