C Programming Codes
13.4K subscribers
139 photos
2 videos
12 links
C Programming Codes || Quizzes || DSA

Learn along with the community

Any queries
admin - @Pradeep_saii
Download Telegram
Which operator is used for finding the remainder of the division in C?
Anonymous Quiz
24%
a. /
65%
b. %
6%
c. *
5%
d. //
👍19👏51
How do you include the standard input/output library in a C program?
Anonymous Quiz
88%
b. #include <stdio.h>
3%
c. #import <stdio.h>
4%
d. include <stdio.h>
8👍8🔥2
👍15🔥21
👍224😁3🔥1🤔1
👍30😁4
What is the output of printf("%d", 5/2); in C?
%
Anonymous Quiz
45%
A. 2.5
47%
B. 2
7%
C. 2.0
2%
D. 4
31👍15🥰3👌3🤯2
How is a single-line comment written in C?
Anonymous Quiz
64%
A. // Comment
27%
B. /* Comment */
4%
C. -- Comment
6%
D. # Comment
👍4120👌4💯3👏2😁2

Join our c programming community 👇

https://t.me/C_programming_language_group

Be the first to help others 👍
👍61
Which individual is often referred to as the "father of C" programming language?
Anonymous Quiz
79%
a) Dennis Ritchie
7%
b) Ken Thompson
8%
c) Bjarne Stroustrup
6%
d) James Gosling
👍199🔥3

#include <stdio.h>
int main() {
int x = 5;
printf("%d", x++);
return 0;
}
👍11🥰105👏3
What will be the output of above code?
Anonymous Quiz
47%
6
4%
4
15%
Error
34%
5
👍34🤯198👏7👌7😁4🤔1🙏1
Which keyword is used to define a constant in C?
Anonymous Quiz
67%
a) const
6%
b) final
13%
c) define
13%
d) constant
👍26🤯73👏1😁1
#include <stdio.h>

int main() {
int x = 10;
int *ptr = &x;
*ptr = 20;
printf("%d\n", x);
return 0;
}
👍40🤯95👏3👌3
🤯36👍31😁7
💻 C++ Codes , Along with DSA 💻
🔥73🤯2
Printing Hello World
#include <iostream>

int main() {
std::cout << "Hello World";
return 0;
}
👍117
Program to swap values of two variables.
#include <iostream>

int main() {
int a=1;
int b=2;
int temp;
std::cout << "Before Swapping:\n";
std::cout << "a=" << a <<",b=" << b <<"\n";
temp = a;
a=b;
b=temp;
std::cout << "After Swapping:\n";
std::cout << "a=" << a <<",b=" << b <<"\n";
return 0;
}
👍11👏21
Program to convert temperature from Fahrenheit to Celsius.
#include <iostream>
using namespace std;
int main() {
double fahrenheitTemperature;
double temperatureInCelsius;
cout << "Enter your temperature in Fahrenheit:";
cin >> fahrenheitTemperature;
temperatureInCelsius = ((fahrenheitTemperature - 32) * 5) / 9;
cout << "Temperature in celsius : " << temperatureInCelsius;
return 0;
}
👍83🔥2
Program to calculate area of circle.
#include <iostream>
#include <cmath>

using namespace std;
int main() {
double radius;
double area;
const double PI = 3.14;
cout << "Enter the radius of the circle: ";
cin >> radius;
area = PI * pow(radius,2);
cout << "Area of circle: "<< area;
return 0;
}
👍82
Program for rolling dice.
#include <iostream>
#include <cstdlib>
#include <ctime>

using namespace std;
int main() {
int result;
const short maxValue = 6;
const short minValue = 1;
srand(time(nullptr));
result = (rand() % (maxValue - minValue + 1)) + minValue;
cout << result;
return 0;
}
👍12