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 |
#include <stdio.h> int main(void) { int a=4, b=2; a=b<<a+b>>2 ; printf("%d",a); return 0; }
What are the following notations of defining functions known as? i. int abc(int a,float b) { /* some code */ } ii. int abc(a,b) int a; float b; { /* some code*/ }
#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }
main() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } How scanf will execute?
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }
why is printf("%d %d %d",i++,--i,i--);
Under linux environment can u please provide a c code for computing sum of series 1-2+3-4+5......n terms and -1+2-3+4-5...n terms..
#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above
how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.
0 Answers Mbarara University of Science and Technology,
Write a program to receive an integer and find it's octal equivalent. How can i do with using while loop.
main() { int i, n; char *x = “girl”; n = strlen(x); *x = x[n]; for(i=0; i<n; ++i) { printf(“%s\n”,x); x++; } }
Design an implement of the inputs functions for event mode