15,551 Topics
| |
/* EXCHANGE THE INTEGER VALUE WITHOUT USING THE THIRD VARIABLE */ #include<stdio.h> void main() { int a,b; printf("enter the two integer variabe \n"); scanf("%d,%d",&a,&b); //exchange the value of a to b ,b to a without using third variable a=a+b; b=a-b; a=a-b; printf("%d%d",a,b); getch(); } /*EXAMPLE: A=3,B=10 A=A+B; // A=3+10=13 B=A-B; … | |
1. #include<stdio.h> #include<conio.h> int main() int a=10; printf("%d%d%d",a,a++,++a); getch(); return 0; } o/p:12 11 11 #include<stdio.h> #include<conio.h> int main() { double a=5.2; if(a==5.2) printf("equal"); else if(a<5.2) printf("less"); else printf("high"); getch(); } o/p: less Can any one give me explanation for the above outputs..... | |
while compiling "hellow, world" program in C (using turto c++) it shows error as -cannot open include file '<studio.h>' -function printf should have prototype i have written the code as #include <stdio.h> main() printf("Hellow, world\n"); return 0; } please help me | |
Hi all I have a function and it is being called by many other functions. Is there any method or macro which can return the function name which calls the current function. EX: [code] int a() { pintf (<required a macro for printing the caller function name>); /* do operation … | |
Hi , I am trying to do a couple of bitwise operations on some hex numbers but for some reason i cant compile. Apparently, it wont be possible with my method: #include <stdio.h> float tv,lv; float nv = 0x01FE; int main() { tv = 0x7FFC; lv = 0x8000 & tv; … | |
Hi, Thanks to everyone who would be reading this post. I would like to know how to write programs in C to control Hardware for modems, printers and how to get the basic concepts for writing device drivers. thanks once again !! Prithwish | |
I was trying to solve the Euler problem number 50, and wrote the following code and got the answer as, no. of primes = 536 and prime value is 958577 But, when i search the answer for this on internet, it says 543 primes and prime is 997651 why does … | |
I have been trying to print all the combination of a string using recursive call. I have studied a code given below . It prints the combination but now i have to store the strings in an array . And i don't get it how do i do that ? … | |
Whenever I try to run this code in turbo c++ 4.5 I recieve an error "General Protection Exception List.c 60 List(2) 0x24DF:0x0157 processor Fault" whereas when the same Program is run in Turbo c++ 3 Dos version It Compiles and Runs Propely without any error. Please Help. #include <stdio.h> #include … | |
Hi guys. I'm pretty new to C program. I've been given this assignment to write a program that asks the user thow many terms of the serires equation to use in approximating PI. The formula given is pi=4X(1- 1/3 + 1/5 - 1/7 + 1/9 - 1/11 + 1/13 - … | |
| |
Hi, Can anyone give me an efficient algorithm for adding an element into a sorted matrix of linked list such that the size of the columns remains constant. Thank-you, Sri | |
Demonstrates the Right Hand Rule maze solving algorithm, with some sweet console colors and text display and erasing, in Windows. Note that if the Start is moved away from all the walls in the maze, the right hand rule fails, circling endlessly. Also, a similar failure happens if the Start … | |
| Hey Guys, I need your expertise. Please help me. In the following program, 2 matrices and given values and then displayed. The program works fine but I really can't understand how it works. #include <stdio.h> #include <stdlib.h> void getmat(int a[50][50],int n) { int i,j; for(i=0;i<n;i++) for(j=0;j<n;j++) scanf("%d",&a[i][j]); } void printmat(int … |
Write a program that will asks the user for a positive integer input. Print the even numbers between 1 and the inputted number on the screen. 2.2. Write a program that will compute the sum of the first N odd numbers. Example: If the value of N is 5, then … | |
hi every one! i have a question, how to pass arguments from other functions to main. i want to write a program like nano well not exactly like nano editor. I have a function f_read(char* filename[]), and fopen() get filename[1] as file name and *filename[2] as "r" read mode and … | |
Hey everyone. I'm trying to use the g2 library in CodeBlocks but I can't seem to get it properly installed. Can somebody please explain me what to do, step by step? Best regards | |
So I just found out what Rot13 is and what its suppose to do but I now I have to implement a code that will allow me to execute Rot13. Does anyone have any tips on where I should start? (besides the beginning -__-). Any help is appreciated! thank you! | |
Hey there, please help me how to solve this problem. I need to find my CPU temperature in C code on Linux for my new program. Can anyone tell me??? | |
For the MIPS assembly instructions below, what are the corresponding C statements. a) addi f, f, 4 b) add f, g, h sub f, i, f So far, I have this but I don't if it is correct. a) f = (f + 4); b) f = g + h … | |
Hello i implemented this FIFO queue: #include <stdio.h> void enqueue(int *, int); int dequeue(int *); int qempty(void); int head = 0; int tail = 0; int qerror(void); #define N 4 int main(void) { int i = 0; int v[N]; while (i < 10) { enqueue(v, i); i++; } while (!qempty()) … | |
I am attempting to recompile a C program i programmed on linux. These are the errors i recieve: c:\users\dsu\dropbox\codes\c\gamereedtucker\main.c(28): error C2275: 'FILE' : illegal use of this type as an expression c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(66) : see declaration of 'FILE' c:\users\dsu\dropbox\codes\c\gamereedtucker\main.c(28): error C2065: 'sy' : undeclared identifier c:\users\dsu\dropbox\codes\c\gamereedtucker\main.c(29): error … | |
My task is to create a complete binary tree. The only requirements are that it be a dynamic tree with nodes and pointers - I may use temporary arrays to help with the intial tree construction. Where I need help is with the insert(Node) method. Here's what I have so … | |
Hello guys, I need to make a program that counts the number of times a particular word appears in a text file on a line. For example, the User chooses the word "test" to be told at the end of each line of txt should show how many times that … | |
http://www.getfriendlynotes.com/index.php?q=topic_disp&subsno=3&prog=431251#tpc1 | |
main() { int a=0,b=0; a=(b=75)+9; printf("/n%d,%d",a,b); } | |
optput its not proper i am tring to print 1 to n given number prime number plese solved error..... | |
#include <windows.h> #include <stdio.h> #include <conio.h> void gotoxy(int x,int y); int main(int argc, char *argv[]) { char urname[1],surname[1],fullname[1]; start: system("COLOR 1c"); gotoxy(11,9); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291); printf(" "); gotoxy(11,10); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291); printf(" "); gotoxy(11,11); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291); printf(" "); gotoxy(11,12); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291); printf(" "); gotoxy(11,13); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291); printf(" "); gotoxy(11,14); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291); printf(" "); gotoxy(11,15); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291); printf(" "); gotoxy(14,10); … | |
/* Hi, In my process of C code optimization*/ Clip(int Val) { return (curr < 0 ? : ((curr > 255) ? 255 : curr)); } /* I want the int value to be clipped between 0 to 255. Is there any other way to optimize above code snippet? */ | |
/*Hi, I was trying to optimize my application in C. In that process to reduce the complexity at condition checks which of the below is efficient,*/ if(bFlag1 && !(Var == 1) && bFlag2) //or if(bFlag1 & !(Var == 1) & bFlag2) |
The End.