- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 81
- Posts with Upvotes
- 74
- Upvoting Members
- 57
- Downvotes Received
- 29
- Posts with Downvotes
- 17
- Downvoting Members
- 14
Write a C program to Remove even numbers and fill it with zeros. Note: You can use only one loop for your logic. Two variables apart from the array. Input array 1,2,3,4,5,6 Output 1,3,5,0,0,0 |
|
Hello How can I get minimum number of coins for a given amount. I have fixed denominations of cents - 25, 10, 5 and 1 If I have 0.67 then what will be the minimum numbers coins I need Thank you all in advance for valueable advices and suggestions |
|
I have to do my project using C++, should I firstly read a book about that and after that write the programming, or it's better to start wtiring my code and solve my problems and questions at the same time? |
|
Hey all, I was wondering about this piece of code on how to make it simpler to find the needle in the haystack for example "abbaabbaabb", "abba" - the needle, "abba" is found 2 times in the haystack "abbaabbaabb". I have this code: unsigned int substringCount(const std::string& strng, const std::string& … |
|
kindly help me in making program in the permutaion of 1,2,3,4,5. Permutation means the arrangements of the numbers 1,2,3,4,5. ex. 1,2,3,5,4 1,2,4,5,3 and so on.. there are 120 results. |
|
I'm having a problem with a program of mine at the moment. Basically, the thought process was to see if the input was whether an int or a string. But as soon as I tried to test it out, it produced an error along the lines of "could not convert … |
|
in data structure, how the paranthesis balanced are checked with stack.little confusion in it. |
|
how to find length of a character string without using while loop or user defined function? |
|
int game() { int n; cout << "enter an odd number: "; cin >> n; int MagicSquare[n][n]; // It says that the expression must have a constant type? int newRow,newCol; int i = 0; int j = n / 2; for (int i = 0; i < n; i++) { … |
|
Hi guys, If i have a file like the one below what would be the best/easiest way to sort the words in alphabetical order. thanks. with an equal mix of biosolids to make the compost Sawdust is on their greens Compost applied properly will enhance growth of grass flowers shrubs … |
|
So I was writing a program that would take a string from clipboard, do some stuff and put the new string back to clipboard. My code so far is posted below. The problem is I want my program to wait for me until I 'ctrl+C' something. I know that `GetClipboardData()` … |
|
how to solve pattern given below using nested for loops.. * * * * * * * * * *********** somebody please help me with the logics. |
|
#include <cstdlib> #include <conio.h> #include <iostream> #include <stdlib.h> using namespace std; int main(int argc, char *argv[]) { int x,ctr; cout<< "Enter a day: "; cin>> x; for (ctr=x;x>0;x--) for (ctr=1;ctr<=12;ctr++) { switch (x) { case 1:cout<< "On the first day of Christmas\nMy true love sent to me...\n"; break; case 2:cout<< … |
|
This function takes a string and an output buffer and a desired width. It then copies the string to the buffer, inserting a new line character when a certain line length is reached. If the end of the line is in the middle of a word, it will backtrack along … |
|
A prime number (or a prime) is a natural number greater than 1 that can only be divided by 1 and itself. Ex-First few Prime number are- 2, 3, 5, 7, 11, 13, 17, 19,... A digit prime is a prime number whose sum of digits is also prime. For … |
|
hi. i am marsh a student guys i have a activity but i don't know to start it with a loop. can you help me? ***** ***** **** **** *** *** ** ** * * ** ** *** *** **** **** ***** ***** |
|
|
|
int arr[]={12,17}; printf("\n arr = %d , &arr= %d",arr,&arr); printf("\n arr+1 = %d , &arr + 1= %d",arr+1,&arr+1); getch(); } ans : arr=400 &arr=400 arr+1=402 &arr+1=404 Please tell me how &arr and &arr+ 1 works? |
|
Im trying to add Total function and isMono functions to this code. Did total already Need help with function ismono which returns whether a tree is mono (all the elements are unique aka no element appears more than one time) or not. Please this is the original program #ifndef T_H … |
|
actually, this is an interview question of a company which deals with adds on mobile phones. can anyone give me hint on this ? what can be the answer of this ? it is therotical question though.thanks. |
|
In this code at line number 7, 'p' is a 1D pointer then how come at the print statement it is being considered as 2D pointer ? and when we do 'a+1' then it would cross whole array. I am not able to understand this code. Please explain. Expected output … |
|
I am new to C and am trying to read the characters in a string serially but I keep getting the error > makes pointer from integer without a cast This is my code void UART1PutChar(char Ch) { //char data; //transmit only if Tx buffer is empty while(U1STAbits.UTXBF ==1); U1TXREG … |
|
I have the following code: #include <iostream> #include <conio.h> using namespace std; long filesize(FILE *stream); int main(void) { FILE *stream; char c; int i=0,n; long lSize; stream = fopen("tanc.TXT", "r"); fseek (stream , 0 , SEEK_END); lSize = ftell (stream); rewind (stream); cout<<"Dati numarul de caractere:"; cin>>n; while(!feof(stream) && i<lSize) … |
|
remove a pattern "ffffff" from string "f a1 2 5 ffffffde 23 fffffff1 4 b0" using c code |
|
I am trying to write a simple text file translator, will translate the text into morsecode. I need something like this to be done: for(i = 0; i < list.size(); i++) { if(list[i] == character_from_file) { translatedLine = list[i_the_second]; } } I am wondering if I can use the "list" … |
|
#include <stdio.h> int *check(); int main() { int *c; c = check(); printf("%d\n", c); return 0; } int *check() { int i=10; int *p=&i; return p; } |
|
Hi All, I've just started to learn C from "The C Programming Language" (Kernighan). One of the exercises asks you to write function that folds a line of text into newlines after x number of characters without splitting a word. This is my attempt so far: // fold: folds the … |