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 |
#define a 10 void foo() { #undef a #define a 50 } int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } explain the answer
plz send me all data structure related programs
Ramesh’s basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.
Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)
main() { extern int i; i=20; printf("%d",sizeof(i)); }
How to palindrom string in c language?
#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }
void main() { int i=i++,j=j++,k=k++; printf(“%d%d%d”,i,j,k); }
main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(“%u %u %u %d \n”,a,*a,**a,***a); printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1); }
#ifdef something int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
write a program in c to merge two array
Write, efficient code for extracting unique elements from a sorted list of array. e.g. (1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9).
13 Answers Intel, Microsoft, TCS,