Discover the world's scientific knowledge

With 135+ million publication pages, 20+ million researchers and 1+ million questions, this is where everyone can access science

You can use AND, OR, NOT, "" and () to specify your search.

PublicationsAuthorsQuestions
How does the switch construct in c programming work and why does the complier skip the statements written within the case?
Question
  • Feb 2015
In a switch construct, why doesn't the compiler show any error and skips the statements written within the cases like for example I write printf("hello"); in between case 1 and case 2, so why is there no error in this and how come the compiler skips this step?
For example I write
case 1: int a=9; break;
printf("hellooo");
case 2 : int y =98;
printf("kill");
break;
So here when parsing is done either the compiler should throw any error because of the printf statement or it must print the statement which is written between the two cases but it skips it. Why does it happen?
… 
  • 53 Views
  • 24 Answers
How to implement Elliptical low pass filter in C Programming?
Question
  • Mar 2016
Hello Everyone,
I want to implement elliptical low pass filter in C.
But i am finding difficulty in it.
Can any one please guide me how i can implement it?
Looking forward for your reply.
Best regards
Awais
… 
  • 1 Answer
String calculator in c++?
Question
  • Nov 2017
hello
i need to do a task in c++ and i am asked to write a c++ program to get n number (as string because they are big numbers) and calculate n operation on them
something like this: 2542585 * 12555 - 1257 + 45458 / 487525
and also it is necessary to prefix,infix and postfix be concluded in the program .
would you please help me?
thanks the best
… 
  • 10 Answers
Loop dependence analysis ways?
Question
  • May 2020
Hello everyone, I am working with c++ codes and I want to know if there are any techniques and examples that I can use and understand to show the way of analyzing the dependence between loops.
… 
  • 80 Views
  • 4 Answers
What are the advanced topics of C++ that need to be learnt to become an expert C++ coder ?
Question
  • Apr 2014
I am familiar with topics like classes, pointers, templates and all the basics. But I am unable to do any project using these.
… 
  • 9 Answers
How can I read multiple files in C++ in the same program?
Question
  • Apr 2014
I have made a program to read pdb protein structures in C++. The problem now is I have 230 such protein structures (in pdb format similar to txt). The program works fine for 1 pdb file (inFile.open("1F56.pdb");). The pdb IDs for 230 protein structures are random. e.g like 1CYX.pdb, 3UW1.pdb etc.
I want my program to read those 230 pdb files one by one and print the output in a text file.
Google results are confusing me.
… 
  • 5 Answers
How to use some randomly pixel (data) from given set of data in opencv ?
Question
  • Feb 2016
I have data in 512 by 512 (type double ). I want select 30 or 40 percentage of total data randomly. I can split data in x:y ratio. But in this method I can divide only from first to given range. Ex. 1 to 30 from 1 to 100. I want to use 30% of total data (ex. select 30 data randomly from 100). Please give me idea or link for code in opencv.
… 
  • 166 Views
Can anyone help me on a problem using C arrays?
Question
  • Apr 2014
The question was,
In Bouboun University's information systems 3 arrays are used to store student details,
1. Stud_Names (array of strings) holds the name of 100 Students
2. Stud_Map (array of strings) hold the ids of the 100 students (whose details are stored in Stud_Name)
3. Stud_Marks_Mod1 (array of floats) holds the grades of grades of each of the 100 students in Module1
4. Stud_Marks_Mod2 (array of floats) holds the grades of grades of each of the 100 students in Module2
5. Stud_Marks_Mod3 (array of floats) holds the grades of grades of each of the 100 students in Module3
Write a program in C which computes the average marks for each student and displays the highest average.
Problem: When I enter details for the first student it is correct but when I enter the second student details I cannot enter the name. It skip it and student ID come in its place. Any advice on how to correct the codes?
My program:
#include <stdio.h>
#include <string.h>
int main()
{
char Stud_Names[100];
char name;
char Stud_ID[100];
float Stud_Marks_Mod1[100];
float Stud_Marks_Mod2[100];
float Stud_Marks_Mod3[100];
const int MAXLENGTH = 100;
int b=1,i,sum=0;
float avg,avg1;
int max=0;
for(i=0;i<2;i++)
{
printf("Enter student %d name: ", b);
fgets(Stud_Names,MAXLENGTH,stdin);
Stud_Names[i]=name;
printf("Enter student %d ID: ", b);
scanf("%s", &Stud_ID[i]);
printf("Enter student %d marks for module 1: ", b);
scanf("%f", &Stud_Marks_Mod1[i]);
printf("Enter student %d marks for module 2: ", b);
scanf("%f", &Stud_Marks_Mod2[i]);
printf("Enter student %d marks for module 3: ", b);
scanf("%f", &Stud_Marks_Mod3[i]);
sum = Stud_Marks_Mod1[i] + Stud_Marks_Mod2[i] + Stud_Marks_Mod3[i];
avg1=sum/3;
printf("Average of student %d mark is %.2f \n",i+1,avg1);
b++;
}
if(avg1>max)
{
printf("Highest average mark is %.2f ", avg1);
}
return 0;
}
… 
  • 10 Answers
How to make a (C++) Program to calculates All Roots of a quadratic equation with two variable ?
Question
  • Apr 2020
i can solve it for 1 variable but i have problems with 2 ..
… 
  • 3 Answers
Does anyone know how to convert delphi codes to C++?
Question
  • Apr 2015
a good convertor is needed
… 
  • 4 Answers
1
2
3
4
5
6
7
8
9
10
App Store
Get it on Google Play
Company
About us
News
Careers
Support
Help Center
Business solutions
Advertising
Recruiting
© 2008-2023 ResearchGate GmbH. All rights reserved.
  • Terms
  • Privacy
  • Copyright
  • Imprint
Join for free
Log in