i am trying to find combination of numbers . i tried following code but its not working. it is giving strange output. can anyone please fix this code or give me working code?
#include...
Type: Posts; User: san12345
i am trying to find combination of numbers . i tried following code but its not working. it is giving strange output. can anyone please fix this code or give me working code?
#include...
i tried following function to find middle element of singly linked list, but its not working. Can anyone help please?
findmiddle(node *head){
node *p1, *p2;
p1 = head;
p2 = head;
i want to reverse doubly linked list. this is the code i tried but its not working. it is printing only first value. i have passed first node to this function.
reverse(node *t)
{
...
i can convert code to function but the problem is in while loop. why its printing garbage values infinitely?
i am trying to write binary tree program in c.
but its not printing the values. and it is not coming out of while loop.
this is the code i tried
#include <stdio.h>#include <stdlib.h>
...
Thank you very much..now its working
i want to make binary tree program in c, but i am getting segmentation fault error.. my code is this...
#include <stdio.h>#include <stdlib.h>
typedef struct node {
int data;
...
Hey Thanks man. this code is working !!
yes i have done using for loop
for(i=1;i<=n;i++)
printf("%d\n", i);
but i want to do it using recursion
please can you explain me? how to solve further?
i want to write program which prints all natural numbers from 1 to n.
where n is user input. but i want to write using recursion and not by for loop.
ex. if user enters 5 then output should be 1 2...
please help me i m making program which takes a number from user and then make greates 3 digit number from the digits of that number
ex. if user type 57149 then output should be 975 because this is...
i want to insert node at nth position but when i press 1 to insert value program stops working means its not inserting value.
what is wrong in this code?
#include <stdio.h>
#include <stdlib.h>...
thx for reply
i want to make program to find closest number in array
ex. if array elements are 2,7,78 and user types 89 then nearest element to 89 is 78 so it should print 78 but it prints 100
why?
i think...
i want to write program to print alternate characters in string
i have tried following code but it prints first character at infinte times
whats wrong in below code?
#include <stdio.h>
...
i have write code for searching element in array of intgers
its working but i have to do this program using function.
can anyone write code for function?
i cant write here but you can see this link Number Patterns - Program in C
there are so many pattern programs but they didnt explain any of them
can you explain me how the code works?
hi all
i want to print pattern programs.i google but i dont understand whats the logic of this program. what is the easy way to remember such programs. where to start from?
thxx problem solved...i just use name[100] and author[100] at start of program and problem solved...:biggrin:
its not working... last printf() statemment not executes and i got program has stoped wroking error
#include<stdio.h>
struct book
{
char name;
char author;
int pages;
float price;
};
void main()
{
thx for reply. your code is working but is it posible to make it using struct only... instead of typedef
im making simple program to read roll number and name of 5 students but it only prints roll no of 1st student whats wrong in code?
#include<stdio.h>
void main()
{
struct student
I want to bring out of marks in my collage exam
So I want to learn c program from basic
That's why I'm asking questions