If you want to overwrite the buffer with the reversed string you can use the following code
#include <stdio.h>
#include <string.h>
main()
{
char s2[100],temp;
FILE *fp;
...
Type: Posts; User: thillai_selvan
If you want to overwrite the buffer with the reversed string you can use the following code
#include <stdio.h>
#include <string.h>
main()
{
char s2[100],temp;
FILE *fp;
...
For reading the file into the buffer you can use fgets and fgetc functions.
Here is a sample program using fgets function.
#include <stdio.h>
#include <string.h>
main()
{
If you want to remove the duplicate elements use the below code
#include <stdio.h>
#include <stdlib.h>
void sort(int a[],int n,int);
int i=1;
int data[100];
int n;
Using insertion sorting algorithm we can sort in the following way.
#include <stdio.h>
#include <stdlib.h>
void sort(int a[],int n,int);
int i=1;
int data[100];
main()
You try the following code
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BUFFER_SIZE 50
int main()
can you place the code of the checkSwitch function. Or better briefly explain the flow of that function
You can use the following way also.
#include<stdio.h>
main()
{
int c;
while ( (c=getchar())!= '\n' )
{
printf("%d\n",c);
The logic of hash will be as follows
A hash table is made up of two parts: An array (it will be like a table which contains the data to be searched) and a mapping function, this is known as a hash...
In this code it means that copying the data in the source to the destination's specific offset.
Usually if you simply used msg->data as a destination in the memcpy function it will be copied to the...
Just change the return type of main from void to int
#include<stdio.h>
#include<math.h>
#include<limits.h>
#include<stdlib.h>
int main()
{
double pi,x,y;
While printing the first character alone use %c instead of %s
Is your requirement parsing the command line arguments?
I too tried your code. Thats work for me.
Instead of ++x if you write x++ then it is giving 125 as a correct answer in the case of CUBE(x*x*x).
And also in case of CUBE(x*x) it is giving the result as 25
Can u tell me by which way have you compiled your code?
And can you ensure that you have compiled with -lm option?
Welcome Bama...
I suggest you to go through the following URL which lets u get familiar with two dimensional arrays.
TWO-DIMENSIONAL ARRAYS.
Yeah. Great!!
Yeah.!!!
Sample:
#define NUM_STUDENTS 100
#define NUM_TESTS 5
for( i = 0; i < NUM_STUDENTS; i++)
for( j = 0; j < NUM_TESTS; j++)
grades[i][j] = value;
Here i is the row of the two dimensional array "grades".
j is the column of the grades array...
** means pointer to pointer.
Generally we will have pointer to integers, pointer to characters.
Similar to these things ** is a pointer to another pointer.
Sample pointer to pointer declaration...
Actually in a BST ( binary search tree ) each node will contain an individual values. These are considered as keys.
The properties of the binary search trees are as follows
The left subtree of a...
Welcome jaja... According to your query I made a little changes. Hope this will solve your requirement completely.
int main(void)
{
int n;
int count = 0;
add another condition with n>=5.
So this will not include 0 now.
the corrected code is given below
int main(void)
{
int n;
int count = 0;
printf("Process %02d of %d on %s\n", rank, size, name);
Kindly use like %02d in the printf as mentioned above in your code
Actually you misplaced the comparison operator with the assignment operator.
if ( found_match ==0 ) like wise you need to test the condition instead of if ( found_match =0 )