AmbitionBox
Discover Best Places to work in India
Discover best places to work
Compare & find best workplace
Bring your workplace to life
Highlight your company's perks
Read reviews for 6L+ companies
Rate your former or current company
Discover salaries for 8L+ companies
Calculate your take home salary
Check your market value
Help other jobseekers
Read interviews for 90K+ companies
Interviews questions for 1K+ colleges
Contribute your interview questions
C Programming
Point out the error in the program?
#include < stdio.h >int main() { struct bits { float f:2; }bit; printf("%d\n", sizeof(bit)); return0; }
4
2
Error: cannot set bit field for float
Error: Invalid member access in structure
Option C
#include < stdio.h >int main() { struct emp { char name[25]; int age; float bs; }; struct emp e; e.name = "Suresh"; e.age = 25; printf("%s %d\n", e.name, e.age); return0; }
Error: Lvalue required/incompatible types in assignment
Error: invalid constant expression
Error: Rvalue required
No error, Output: Suresh 25
Option A
We cannot assign a string to a struct variable like e.name = "Suresh"; in C. We have to use strcpy(char *dest, const char *source) function to assign a string. Ex: strcpy(e.name, "Suresh");
Join India’s largest community to research company culture
Are you a student or working professional?
Student/Never worked
I am a student/I have never worked
Working Professional
I am working/I have worked before
What are your preferred job locations?
Popular Cities
Other Cities
Follow your preferred designations/job profiles
Suggestions based on your job profile
vs
Similar Companies