top of page
Search
Writer's picturelinuxtech

Make a simple question asking program from c language.


source code:

#include <stdio.h>

struct student {

char name[50];

int roll;

float marks;

} s;


int main() {

printf("welcome to a simple information collecting program designed by linux tech:\n");

printf("Enter information:\n");

printf("Enter your name: ");

fgets(s.name, sizeof(s.name), stdin);


printf("Enter roll number: ");

scanf("%d", &s.roll);

printf("Enter age: ");

scanf("%f", &s.marks);


printf("Displaying Information:\n");

printf("Name: ");

printf("%s", s.name);

printf("Roll number: %d\n", s.roll);

printf("age: %.1f\n", s.marks);


return 0;

}

7 views0 comments

Recent Posts

See All

HOw to make a simple login form using HTML.

source code: <html> <head> <title>Login Page</title> </head> <body> <form name="loginForm" method="post" action="login.php"> <table...

How to make a simple snake game using html

source code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width,...

How to make a simple chessboard using HTML

source code: <html> <head> <meta charset="UTF-8"> <title>simple chessborad made by linux tech</title> <style type="text/css"> .chessboard...

Comments


bottom of page