A
Talula
A
Anonymous
Any one teach me how to add a two number 😜😜😜😜
Anonymous
im sorry im not a c or c++ developer but i just wanna ask a question is there anyway to convert .fmx oracle forms file type to .fmb
Shubh
int a,b,c,d,e,f,g;
printf("Enter 7 numbers separated by space:\n");
scanf("%d %d %d %d %d %d %d", &a,&b,&c,&d,&e,&f,&g);
int x=a + b % (int)((float)c / (float)d) % e * f - g;
printf("%d", x);
An electricity board charges the following rates for the use of electricity:
For the first 200 units; 80 P per unit
For the next 100 units; 90 P per unit
Beyond 300 units; Rs. 1 per unit
All users are charged a minimum of Rs. 100 as meter charge. If the total amount is more than
Rs. 400, then an additional surcharge of 15% of total amount is charged. Write a program to
read the names of users and number of units consumed and printout the charges with names
Shubh
Shubh
int a,b,c,d,e,f,g;
printf("Enter 7 numbers separated by space:\n");
scanf("%d %d %d %d %d %d %d", &a,&b,&c,&d,&e,&f,&g);
int x=a + b % (int)((float)c / (float)d) % e * f - g;
printf("%d", x);
thankyou
Shubhi
I have been getting an error in the last line of this program
Shubhi
#include <stdio.h>
#include <stdlib.h>
struct listNode{
int vertexNo;
struct listNode *next;
};
struct Graph{
int v;
int e;
struct listNode *adj;
};
struct Graph *adjListOfGraph(){
int i , x, y;
struct listNode *temp=(struct listNode*) malloc(sizeof(struct listNode));
struct listNode *t;
struct Graph *g = (struct Graph*) malloc(sizeof(struct Graph));
printf("Enter the number of vertices and edges:\n");
scanf("%d%d",&g->v,&g->e);
g->adj=(struct listNode*) malloc(sizeof(struct listNode)*g->v);
for(i=0;i<g->v;i++){
g -> adj[i].vertexNo = i;
g -> adj[i].next = g -> adj+i;
}
for(i=0;i<g->e;i++){
printf("Enter the pair of vertices connecting the edges:\n");
scanf("%d%d",&x,&y);
temp->vertexNo=y;
temp->next=g->adj[x];
}
}
Shubhi
Its showing .....a value of type "struct listNode" cannot be assigned to an entity of type "struct listNode *"....please if someone could help
Anonymous
Shubhi
Shubhi
C
Shubhi
Adjacent list representation of graph..
Anonymous
Can anyone make an interpreter in c programming language??? Please ping me asap
Amu
Hi, ive been trying to create the linux ls -R functionality that recursively lists directories using c, i have made some progress but i’ve been stuck on some aspects. I’ll paste the code below, i’d appreciate it if anyone can help. thanks
Amu
if (list_all == false && list_long == false){
char recursion_buf[512];
if (dir->d_type == DT_DIR){
if (strcmp(dir->d_name, ".") == 0 || strcmp(dir->d_name, "..") == 0)
continue;
printf("%s/%s\n", dirname, dir->d_name);
snprintf(recursion_buf, sizeof(recursion_buf), "%s/%s", dirname, dir->d_name);
list_dir(recursion_buf, list_long, list_all, recursive);
}
printf("%s\n", dir->d_name);
Amu
if (list_all == false && list_long == false){
char recursion_buf[512];
if (dir->d_type == DT_DIR){
if (strcmp(dir->d_name, ".") == 0 || strcmp(dir->d_name, "..") == 0)
continue;
printf("%s/%s\n", dirname, dir->d_name);
snprintf(recursion_buf, sizeof(recursion_buf), "%s/%s", dirname, dir->d_name);
list_dir(recursion_buf, list_long, list_all, recursive);
}
printf("%s\n", dir->d_name);
feel free to DM me if anyone can help 🙏
Puspam
Anonymous
Hi family
D
Hi
Anonymous
why is this simple loop not working?
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
int main()
{
int64_t n = 1;
while (true)
{
printf("%lli\n", n *= 2);
}
}
Anonymous
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
// unix (not windows) !!!!
#include <unistd.h>
int main()
{
int64_t n = 1;
int limit = 1000;
while (true)
{
printf("%ld\n", n *= 2);
sleep(1);
limit--;
if (limit == 0) break;
}
}
Anonymous
wouldn't using a for loop be easier?
Anonymous
this code looks like as experimental, not serious
Abhishek
Hey everyone, I am trying to setup wxWidgets using MinGW64 and CMake
Abhishek
So far not even a basic empty window application is loading
Abhishek
I have no compilation errors
I have compiled wxWidgets from source as a sub_directory
Abhishek
Can anybody help me out?
Abhishek
Fixed, had to disable shared libraries for wxWidgets
set(wxBUILD_SHARED OFF)
add_subdirectory(wxWidgets)
Amirali
Hi guys does anyone knows how the Checksum works? (i searched in google and youtube but I got more confused) the only thing I know is something related to ascii value of each char !
Anonymous
where can i learn CMake?
Anonymous
any good resources?
touhou
any good resources?
https://cliutils.gitlab.io/modern-cmake/
Idk if this is good resource , but you can check it out.
Anonymous
This seems good thanks
Captain
Use recursion
Anonymous
I wana data base mangement pdf
Talula
Felix
Excuse me guys i wanna ask for a solution, i have a program here that accept user's input, i want that when the user's input is == 0 , that 0 is undetected(dissapeared), how can i do that?
Thanks.
Talula
Felix
I have a program
int num;
printf("Input Num "); scanf("%d",&num);
if (num==0)
{
num=(deleted by system/not detectable);
}
Felix
i want the 0 to be not detected by the system
Naina
How to check for enter key in c++ ?
Anonymous
If you’re using windows you can use windows.h
Anonymous
And the getasynckey function
Anonymous
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getasynckeystate
Naina
Ok , thank you 👍
Anonymous
You can probably use posix api and you would have to write your own function
Dumb
Mh got it
Talula
Felix
im asking how can i make the value 0 undetected by system
Anonymous
he is asking if you press enter without entering a number the program exits
Anonymous
basically check if scanf is empty
Anonymous
scanf is a bad function anyways
Anonymous
maybe GNU Readline would help ¯\_(ツ)_/¯
Anonymous
Felix
Anonymous
They’re fun
Felix
aight noted
Felix
did array categorized as pointers?
Talula
He is using C I think
#include <stdio.h>
#include <string.h>
int main(void)
{
char str[10];
while(1)
{
char a = getchar();
if (a == '\n')
{
printf("Enter key is pressed\r\n");
break;
}
else
strncat(str,&a,1);
}
printf("%s\r\n",str);
return 0;
}
Anonymous
Talula
Talula
If you want it to be empty check for empty.
Anonymous
he want's empty
Anonymous
if scanf is empty exit
Anonymous
carriage return hehe
Talula
he want's empty
#include <iostream>
using namespace std;
int main()
{
string str;
while (1) {
char a = cin.get();
if (a == '\n')
{
if (str == "")
cout << "Enter key is pressed" << endl;
break;
}
else
{
str += a;
}
}
cout<<str;
return 0;
}