This question was asked in one the technical interview( Under graduate level). This is kind of application for 'replace' feature. You can make it more accurate by putting more constraints.
Ans : #include<stdio.h>int main(){int i=0;char str[100],x ='x',y='y' ;printf("Enter the string\n:");gets(str);while(str[i]!='\0'){if(str[i]=='a'){printf("%c ",x);printf("%c ",str[i++] );printf("%c ",y);}else{printf("%c...
Friday, December 27, 2013
Tuesday, December 24, 2013
How to deallocate dynamically allocate memory without using “free()” function.
NOTE: this is actually puzzle type question nobody use it realloc() function to free the memory. But I heard, in many interviews this question had been asked. Standard library function realloc() can be used to deallocate previously allocated memory. Below is function declaration of “realloc()” from “stdlib.h”
void *realloc(void *ptr, size_t size);
If “size” is zero, then...
Saturday, December 21, 2013
SCANF() - Some important features.
scanf()
The scanf()is very powerful function. We can use it to scan the input but we can add something in it's arguments and make it very powerful function.
Assume that we have one variable : a[100];
To read a string:
scanf("%[^\n]\n", a);
// it means read until you...
Saturday, December 14, 2013
Why should u not use turbo c++ ?
I have seen that in many under graduate collages turbo c++ is still used. But now a days it is an outdated IDE. Please, do not use it. It is totally useless.
Turbo C++
There are many recent IDEs available which has great features and no bugs like GCC or Eclipse C/C++. Now a days...
Friday, November 29, 2013
Wednesday, November 27, 2013
Voice Search On Google
Search by speaking.
- You can now say things like "pictures of …" or "where is …?"
- Fixed browser button in latest versions of Chrome.
Voice Search provides a method to search by speaking. For example,
just click on the microphone and say "kittens" to search for kittens.
If you specifically want pictures of kittens, say "google images
kittens".
Want to learn more about World...
Sunday, November 17, 2013
HOW TO LOG OUT YOUR FACEBOOK ACCOUNT FROM OTHER COMPUTERS?
Facebook
We use to go cyber cafe or any other place and open facebook or from friend's mobile and sometimes we
forgot to log out but now don't need to be worry about it,there is a
option to log out your account from every computer.....follow the
steps... 1. log in your account...
Sunday, November 10, 2013
Different Technologies & Their Founders
If any mistake, inform me ...plz...
1. Google: Larry Page & Sergey Brin 2. Facebook: Mark Zuckerberg 3. Yahoo: David Filo & Jerry Yang 4. Twitter: Jack Dorsey & Dick Costolo 5. Internet: Tim Berners Lee 6. Linkdin: Reid Hoffman, Allen Blue & Koonstantin Guericke 7. Email: Shiva Ayyadurai 8. Gtalk: Richard Wah kan 9. Whats up: Laurel Kirtz 10. Hotmail: Sabeer Bhatia 11. Orkut: Buyukkokten...
Thursday, November 7, 2013
DIFFERENCE BETWEEN CORE I3, CORE I5, CORE I7...??
-> Core i3: * Entry level processor. * 2-4 Cores * 4 Threads * Hyper-Threading (efficient use of processor resources) * 3-4 MB Cache * 32 nm Silicon (less heat and energy)
-> Core i5: * Mid range processor. * 2-4 Cores * 4 Threads * Turbo Mode (turn off core if not used) * Hyper-Threading (efficient use of processor resources) * 3-8 MB Cache * 32-45 nm Silicon (less heat and energy)
...
Tuesday, November 5, 2013
C program to print a semicolon without using a semicolon anywhere in the code.
Generally when use printf("") statement we have to use semicolon at the end.If we want to print a semicolon, we use the statement: printf(";" );In above statement, we are using two semicolons . The task of printing a semicolon without using semicolon anywhere in the code can be accomplish ed by using the ascii value of';'which is equal to 59.Program: Program to print a semicolon without using semicolon...
Tuesday, October 29, 2013
C programs that print hello word without using semicolon
It is easy to run a program that prints hello world without using a semicolon. Here some solutions are given. try new if possible.<Yahh..!! this is for B.Tech guys..!!>......................................................
Solution: 1
#include<stdio.h>
void main(){
if(printf("Hello
world")){
}
}
Solution: 2
#include<stdio.h>
void...
Tuesday, September 24, 2013
How to find median in order of log n ?
Median in an infinite series of integers
Solution: Use 2 heaps: One MaxHeap and one MinHeap.
1) MaxHeap contains the smallest half of the received integers 2) MinHeap contains the largest half of the received integers
The integers in MaxHeap are always less than or equal to the integers
in MinHeap. Also, the number of elements in MaxHeap is either equal to
or 1 more than the number of elements...
Saturday, September 7, 2013
Monday, September 2, 2013
stack programme using structure in C
#include<stdio.h>#include<stdlib.h>#define structsize 10
struct stack{ int top; int item[structsize];};void push(struct stack *ps){ int element; printf("\npush an element:"); scanf("%d",&element); if(ps->top==(structsize-1)){ printf("overflow\n"); ...
Sunday, September 1, 2013
How to find execution time of program in C??
We always eager to know that how much time my program takes to give me output. As a good programmer you always worry about the time complexity. If you print your execution time along with output then you can check your execution time for different test cases. It's really exiting.
#include<stdio.h>
#include<time.h>int main(){clock_t begin, end;begin = clock();double time_spent;
/* ...
Thursday, August 15, 2013
Motherboard
What is a motherboard ??
A motherboard (also known as the mainboard, system board, planar board or logic board) is the main PCB found in computers and other expandable systems. It holds many of the crucial electronic components of the system, such as the CPU, memory, and processor.
motherboard
The...
Thursday, August 1, 2013
How to terminate processes in ubuntu??
In windows we can easily terminate the process by
ctrl+alt+del
right click on program name
go to process
end process.
but in Linux , it is not that much easy, u have to follow the terminal steps:
example: to close firefox process.
Open terminal (ctrl+alt+t)
type command : ps auxwww | grep firefox
u will get some table , in which u find process IDs
type command : kill 2348 (note: 2384...
Tuesday, July 30, 2013
Sunday, July 28, 2013
To print indian map in "c" langauge
#include<stdio.h>#include<conio.h> //for windows only void main() { int a,b,c; for (b=c=10;a="- FIGURE?, UMKC,XYZHello Folks,\ TFy!QJu ROo TNn(ROo)SLq SLq ULo+\ UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\ NBELPeHBFHT}TnALVlBLOFAkHFOuFETp\ HCStHAUFAgcEAelclcn^r^r\\tZvYxXy\ T|S~Pn SPm SOn TNn ULo0ULo#ULo-W\...
Thursday, July 25, 2013
Problem : Firefox is responding very late
many of you might facing a problem with " Firefox web browser" that it responding too late, even input from keyword is also not taking well etc...
I got one solution, after doing this my browser responding nicely.
Go to tools->add-ones->Extention
Remove all your video and Flash plug-ins...
Tuesday, July 23, 2013
Don't use Free() more than once for same pointer
To use Free() more than once cause a "FATAL ERROR" .
"FATAL ERROR" cause CRASH the program,
and because of which we get a segmentation fault as error...
sometime it also make problem when we are doing program in group. one member frees the pointer while actually another fellow is using same pointer.
so never try to use Free() more than once for same pointer. ...
Wednesday, July 17, 2013
How to install java in ubuntu??
First start your terminal ( if not found on desk top try shortcut key ctrl+alt+T)
make sure you are connected to the internet.
update your Ubuntu by the command : sudo apt-get update
then install java (jdk and jre) by the command : sudo apt-get install openjdk-6-jdk openjdk-6-jre
To check if java has been installed in your system, type the following command:javac -version ...
Monday, April 22, 2013
problem: All exe files are opening in vlc
When you try to open any exe file or say shortcuts then it opens in vlc media player that is horrible. I have found some solutions try them .
click here and fix it.If you are unable to open Internet Explorer to access the link, hit the
Windows key plus r on your keyboard and copy and paste the below command
in the Open Box (this assumes that W7 is installed on your C drive):
rundll32...
Tuesday, April 16, 2013
why you not recieving any sms from internet sms website???
Aren't
you receiving any SMS from various online free daily sms sender or is
you phone no more has any notifications of new sms's, that is because of
change in the TRAI rule, most of them are not receiving messages from
the usual sources where they used to get. The rule was passed to
protect consumer privacy from SMS spammers.You
must be shocked to see such kind of errors even while...
Thursday, April 11, 2013
Why bother to learn "C language" Today??
Now a days there are many superior languages are available like C++, java, C# etc, then why to learn C??? There are several reasons for this , as follows-
I believe that nobody can learn such higher languages like C++,java,C# directly because it has things like classes, objects, polymorphism, Exception handling etc..we can learn this complicated components easily when we are comfortable with...