15,551 Topics

Member Avatar for
Member Avatar for Xufyan

sorting in array, i'm stuck understand that why we've used a 'j' loop here ? can anybody explain ? and why we are checking this condition ? [iCODE] if(num[i]>num[j])[/iCODE] [CODE]int main(void) { int num[5],temp; int i,j; for(i=0;i<5;i++) { printf("Enter Value for %d",i); scanf("%d",&num[i]); } for(i=0;i<5;i++) { for (j=0;j<5;j++) { if(num[i]>num[j]) …

Member Avatar for sourabhtripathi
0
98
Member Avatar for rafikul

[code=c] #include<stdio.h> #include<conio.h> void main() { int a[] = {10,20,30,40,50},j,*p; clrscr(); for(j=0;j<5;j++) { printf("%d",*a); a++;/*here compiler error "lvalue required"*/ } p=a; for(j=0;j<5;j++) { printf("%d",*p); p++; } getch(); } [/code] i used turbo c++ compiler.and save this programme as abc.c why this type of errors occur?

Member Avatar for peter_budo
0
182
Member Avatar for bryann

Hi i know this may sound a bit silly but i have looked through some websites but can't really find exactly what the difference is between "=" and "==" For example [CODE]if(x==0) execl(“/bin/ps”, “ps”,”-eal”,NULL)[/CODE] how is that different from [CODE]if(x=0) execl(“/bin/ps”, “ps”,”-eal”,NULL)[/CODE] thanks

Member Avatar for bryann
0
107
Member Avatar for farhanafzal

Write a C program using do while to find and print the average of three exam results of a student that will entered as an input from the keyboard. It repeats as many times as the user wishes. The program will ask for entering new entry (student grades) confirmation and …

Member Avatar for jephthah
0
88
Member Avatar for md3258

I am trying to read a file and place the contents in various arrays. The fields are seperated by commas. I have fields that are strings, doubles, and integers. The string fields may contain characters such as ",&:. The double fields may not all be populated but I need to …

Member Avatar for jephthah
0
95
Member Avatar for speedy94519

Hey is their a standard library that gives false and true values or something or are you suppose to assign them?? Im writing a function that suppose to return true or false. And i also tried replacing the words true and false by !0 (true) and 0 (false) but my …

Member Avatar for jephthah
0
113
Member Avatar for nick22

I am very much a beginner and trying to create a linked list, asking the "user" to input 5 or 6 values. My problem is that I don't know the correct terminology or how to store the user's input so that I can create my pointer to the next value …

Member Avatar for WaltP
0
997
Member Avatar for adxer

how do I go about adding a row to a column in simple code? and then printing out the results.

Member Avatar for WaltP
-2
54
Member Avatar for Ain_ee

i am using linux and C as programming language. I want to display list of time zones to the user. How can i have list of all time zones in C. Also how can i get time zone of my system?

Member Avatar for Narue
0
35
Member Avatar for nath.sai1234

Why the compiler is generating the sentence, Lvalue required. what is the meaning

Member Avatar for Banfa
-1
102
Member Avatar for tquiva

I am trying to create a game and tried compiling my program with my makefile, but I keep getting an error stating that there is something wrong in main. I can't seem to find the error, but this is how my main looks like: [CODE]#include "tfdef.h" #include "movement.h" #include "game_utils.h" …

Member Avatar for Banfa
0
2K
Member Avatar for mariosbikos

[CODE]int sin2(int g) { static int metritis1=1,i=0; int l,c,pin[100],pin2[100]; char result; srand ( time(NULL) ); l = rand() % 10; c = rand() % 10; c=65+c; l=l+1; pin[g]=c; pin2[g]=l; printf("%d and %d the g is %d\n",pin[g],pin2[g],g); while (1){ if (pin[i]==pin[g] && pin2[i]==pin2[g]){ printf("%c kai %d g is %d to i …

Member Avatar for mariosbikos
0
109
Member Avatar for Jaks_maths
Member Avatar for raghuram1987
0
335
Member Avatar for MWE_QUE

Thanks in advance for any help I can get. This is a que I need to add in to another program. It is almost straight out of the book, and a lot like my working stack implementation. It steps through correctly when I go line by line, but I'm not …

Member Avatar for nezachem
0
105
Member Avatar for antra1234

char *default message[]="hghgghjgh" char *message=defaultmessage tis line showing error as 'initializing':cannot convert from 'const char[ 9] to 'char *[]' can u help me....?

Member Avatar for abhimanipal
0
113
Member Avatar for bobyx

Hi.I write a program in C for my microcontroller(PIC 18F452) but faced to a problem that related only to C language and that is; as you can see in my Main program and the two Functions I want to pass an array of ; " int adcvalmax[8] " which got …

Member Avatar for Iam3R
0
190
Member Avatar for ankur.verma

Hi , I am preparing a project in C using mouse handling. I have no idea as to how input(text) taken by user in a graphics mode. Kindly help

Member Avatar for Ancient Dragon
0
47
Member Avatar for Iam3R

Hi, i have written a program to find the power of two numbers using iteration. The problem here is that to return the correct out put for even powers but not for odd powers. b = base , e = expo ,p= power( b, e);; for even powers the statements …

Member Avatar for Iam3R
0
94
Member Avatar for koupas

[CODE]#include <stdio.h> #include <stdlib.h> typedef struct { int finalMark; /* Ï ãåíéêüò âáèìüò ãéá çï ìÜèçìá */ }StudentType; struct var { StudentType *aStudent; char onomaa[20]; char eponimoa[20]; }; typedef struct var newtype; newtype a; main() { int bathmos; char onoma[20]; scanf("%s",&onoma); strcpy(a.onomaa,onoma); printf("%s",a.onomaa); system("pause"); scanf("%d",bathmos); strcpy(a.aStudent->finalMark,bathmos); printf("%d",a.aStudent->finalMark); system("pause"); }[/CODE] this …

Member Avatar for abhimanipal
0
7K
Member Avatar for kavi_90

I have to write a program where the producer gets the some number of inputs from the user and the consumer takes from the shared memory and prints their squares.In my program i have the shared memory size as 5. my program works perfectly in the area that producer and …

Member Avatar for abhimanipal
0
212
Member Avatar for nick.falconer

I'm writing a program of Conway's Game of Life. I think I've figured out most of it but there something wrong with the rules I've set up [CODE=c]for(row=0;row<20;row++) { for(col=0;col<21;col++) { n=0; if (a[row][col]=='*') { if(a[row-1][col-1]=='*') { n++; } if(a[row-1][col]=='*') { n++; } if(a[row-1][col+1]=='*') { n++; } if(a[row][col-1]=='*') { n++; …

Member Avatar for nick.falconer
0
101
Member Avatar for asm2hex

Hello, As of right now I'm in a hard spot. You see at this moment, I've been programming both my client and server. And everything was working very well, until I realized something. The fact that in my client I have multiple threads running and sending data to my server …

Member Avatar for gerard4143
0
79
Member Avatar for chunalt787

I didn't know where to put this but this seemed to be the best place. I took an internship this summer and found out that I will be doing embedded development in C/C++ and Linux for phones(land line voip stuff). This is bad for me since I have always been …

Member Avatar for chunalt787
0
130
Member Avatar for tquiva

I am trying to create a program that reads a data file and computes the water usage for each hour of the day, the average hourly usage for the day, and the time of the highest hourly usage. I already created the main program, and two other functions, along with …

Member Avatar for Adak
0
161
Member Avatar for Joey_Brown

Hello. I would very much appreciate if someone would aid me with a hint. My problem is as follows : read two arrays of chars and merge them into a third array like so : ARR1 :123abc ARR2: rt678iogl ARR3:1r2t36a7b8ciogl The problem must be solved without pointers and string.h Basically …

Member Avatar for Adak
0
398
Member Avatar for Iam3R

Hi, [CODE] #include<stdio.h> int main( void ) { float a = 0.2; if( a > 0.2 ) printf( "\n a is greater than 0.2" ); else if( a < 0.2 ) printf( "\n a is less than 0.2" ); else printf( "\n a is equal to 0.2" ); return 0; …

Member Avatar for Banfa
0
97
Member Avatar for magicg

Hi I want c language code to open my web browser (IE or Firefox) and close it after 2 min. can any one help me?? please i need it.

Member Avatar for Software guy
0
142
Member Avatar for gerard4143

I have a question, well more of a verification. In the program below, I'm packing a character array with some values. The first two are unsigned integers the next is a function pointer and the final is a string of characters...Now my question, is the casting correct for the function …

Member Avatar for gerard4143
1
177
Member Avatar for lionaneesh

[CODE] /* ** showip.c -- show IP addresses for a host given on the command line */ #include <stdio.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #include <arpa/inet.h> int main(int argc, char *argv[]) { struct addrinfo hints, *res, *p; int status; char ipstr[INET6_ADDRSTRLEN]; if (argc != 2) { fprintf(stderr,"usage: …

Member Avatar for jephthah
0
169
Member Avatar for qwerty_touch

Hello, this forum is for asking the required code and logic behind implementing the "factorial program - i.e. finding factorial of any big number"---could someone help me out???/

Member Avatar for 0x69
-1
158

The End.