write a c program to Reverse a given string using string
function and also without string function
Answer / puneet mittal
#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
char string[50],reverse[50];
int i,len=0;
printf("Enter the string = ");
gets(string);
strrev(string);
printf("\n reverse of entered string by using string
function : %s",string);
for(i=0;i<50;i++)
{
if(string[i]!='\0')
len++;
}
for(i=0;i<len;i++)
{
reverse[i]==string[len-i];
}
printf("\n\nreverse of entered sting without using
string function :%s ",reverse);
getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
main() { char *p = "hello world"; p[0] = 'H'; printf("%s", p); } a. Runtime error. b. “Hello world” c. Compile error d. “hello world”
Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange
Who could write how to find a prime number in dynamic array?
How to read a directory in a C program?
#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }
How can I Create a C program in splitting set of characters to specific subsets. Example: INPUT SET OF CHARACTERS: Therefore, my dear brothers and sisters, stand firm. Let nothing move you. Always give yourselves fully to the work of the Lord, because you know that your labor in the Lord is not in vain. SPLIT INTO HOW MANY CHARACTERS PER SUBSETS: 10 OUTPUT: Therefore, my dear b rothers an d sisters, stand fir m. Let not hing move you. Alway s give you rselves fu lly to the work of t he Lord, b ecause you know that your labo r in the L ord is not in vain.
Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector
main() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }
How do you write a program which produces its own source code as its output?
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.
main() { int a[10]; printf("%d",*a+1-*a+3); }
main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); } int i;