- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
Re:
Hello everybody, I was asked by an interviewer the following question. but I was not able to answer. Please get back to me if you know the answer. thank you in advance. Que: What is the exact difference between the "for" loop and "while" loop in C language ? |
|
Re:
[CODE]#include<stdio.h> #include<conio.h> //header file declaring void main() { int a,i; clrscr(); printf("\n Enter the Number:"); //get value scanf("%d",&a); if(a%2==0) { printf("\n Not prime number"); } else { for(i=3; i<a; i=i+2) { if(a%i==0) { printf("\n Not a prime"); break; } } printf("\n Prime number"); } getch(); } [/CODE] |
|
Re:
Hi guys, I started learning C a few days ago, watching as many youtube tutorials as possible but there aren't many tuts on youtube :/ Can anyone recomend me a good book or list of tutorials? I started to read "The C Programming Language" by dennis ritchie but It's a … |
|
Re:
can you please help me again to this?:( cause the previous one I've asked to you i didn't get it :(( write a program that determines whether a given positive integer is an armstrong number. -----armstrong number is an n-digit number that is equal to the sum of the nTH … |
|
Re:
The random function, generates the same values each the time program is run.. Any other function to output random numbers, each time the program is run ?? |
|
Re:
This code is not running. i'm using gcc [code=c] #include<stdio.h> int main() { struct book { char name[10]; float price; int pages; }; struct book b[5]; int i; for (i=0; i<5; i++) { printf("Enter name, price and pages\n"); scanf("%c %f %d", &b[i].name, &b[i].price, &b[i].pages); } for (i=0; i<5; i++) printf("%c … |
|
Re:
If i'm scanning from keyboard using getch(), how do i check which arrow key has the user pressed??(Arrow keys have ASCII values same as some other keys so we can't directly check for ASCII values) |
|
Re:
[CODE]#include<stdio.h> #include<conio.h> main() { char c; printf("Enter the code for the chart: \n"); do { scanf("%c",&c); switch (c) { case 'A':printf("Area Chart\n");break; case 'B':printf("Bar Chart\n");break; case 'U':printf("Bubble Chart\n");break; case 'C':printf("Column Chart\n");break; case 'N':printf("Cone Chart\n");break; case 'Y':printf("Cylinder Chart\n");break; case 'D':printf("Doughnut Chart\n");break; case 'L':printf("Line Chart\n");break; case 'I':printf("Pie Chart\n");break; case 'P':printf("Pyramid Chart\n");break; case … |
|
Re:
guys pls help me to creat a progam using array that will display the ff sequence 1,1,2,3,5,8,13,21,3,55 after displaying the fibonacci series tha program will ask for an array psition & will display its corresponding value this is done continnously... please... |
|
Re:
[CODE] #include<stdio.h> #include<conio.h> main() { char c; printf("Enter the code for the chart: \n"); do { scanf("%c",&c); switch (c) { case 'A':printf("Area Chart\n");break; case 'B':printf("Bar Chart\n");break; case 'U':printf("Bubble Chart\n");break; case 'C':printf("Column Chart\n");break; case 'N':printf("Cone Chart\n");break; case 'Y':printf("Cylinder Chart\n");break; case 'D':printf("Doughnut Chart\n");break; case 'L':printf("Line Chart\n");break; case 'I':printf("Pie Chart\n");break; case 'P':printf("Pyramid Chart\n");break; … |
|
Re:
We are asked to input 10 integers where in we need to display: 1. The sum of all the odd numbers 2. The sum of all the even numbers I do not know how to make a statement and i do not know whether to use for or while and … |
|
Re:
i found a very simple program that is very simple but have a great logic. [CODE] #include<stdio.h> #include<conio.h> void main() { int B=1; printf("%d\n%d\n%d",b=15,b>9,b<9); getch(); } [/CODE] this seems very simple to me but the output is very strange to me OUTPUT:- 15 0 1 I tried very much to … |
|
Re:
Please help me. Can you guys tell me how to put a background color in C. |
|
Re:
[CODE]#include<stdio.h> #include<conio.h> #include<string.h> #include<ctype.h> int main() { char org[50],r[50],m[50],a; int i,j,c=0,length=0,h=0,g=0,z; char token [3] [20] = { "void", "main", "int"}; printf("\nenter a line:"); gets(org); for(i=0;org[i]!='\0';i++) { length++; } for(h=0;h<3;h++) { for(g=0;g<length;g++) { z=strcmp(org[g],token [h]); if(z==0) printf("Keyword:%s\n\n",m); else printf("NO_Keyword:%s\n\n",m); } } printf("\n"); system("pause"); return 0; }[/CODE] it is showin this warning....[Warning] … |
|
Re:
I have problem in this c program [CODE] #include <stdio.h> int main() { int this_is_a_number; printf( "Please enter a number: " ); scanf( "%d", &this_is_a_number ); printf( "You entered %d", this_is_a_number ); getchar(); return 0; }[/CODE] when i press ctrl+F9 the output screen appears " Please enter a number:" and … |